Skip to content

'runWithException' should throw instance of Error #40

Open
@geigerzaehler

Description

@geigerzaehler

Decoder.runWithException() throws a plain DecoderError object which is not an Error instance. This means that the error has no stack trace attached and does not play well with generic exception handling mechanisms that expect an Error instance. (In my case, the error object was logged by Sentry which failed to provide useful information like error message and stack trace.) The same issue exists with Decoder.runPromise().

I’d suggest turning DecoderError into a subclass of Error, providing it with a message, and keeping the rest of the attributes. (Maybe it would make sense to drop kind in favor of the more standard name.) This change would be backwards compatible. I’d be happy to implement the change.

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