Skip to content

Migrate errors to static enums #113

@jedel1043

Description

@jedel1043

Our current design for TemporalError is essentially a mirror of ECMAScript's error types:

temporal/src/error.rs

Lines 39 to 43 in 345ad54

#[derive(Debug, Clone, PartialEq)]
pub struct TemporalError {
kind: ErrorKind,
msg: Box<str>,
}

This works well for engines that have thousands of errors, with each one having a custom message. However, I don't think we need to do that for temporal_rs, and a more rusty approach will be better suited for this. thiserror sounds ideal for this (moreso because it recently added support for no_std).

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-internalInternal library improvementsE-easyEasy issue to fix - Good for newcomersE-help wantedExtra attention is needed

    Type

    No type

    Projects

    Status

    Ready

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions