Skip to content

Custom Error Types #35

@impguard

Description

@impguard

Curious, how hard would it be to allow for this library to support custom error types? One of the biggest advantages of using a type for error handling vs. traditionally supporting exception based promise handling is that you can actually parse and typecheck your errors.

As it stands, the custom error type is fairly opinionated: requiring an error code, error context code (which must be integers), and only being flexible on the error info as a string.

What would be the most flexible way to support custom error types beyond a string? I took a stab at looking at how hard it would be templatize the error, but it seems like this would actually be a massive change across the board.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions