Skip to content

Implement custom errors #859

Closed
Closed

Description

@callmehiphop

Related to #857 (comment)

It would be nice to have custom error types in certain places to improve the error messages we provide to the user - instructing the user to access non standard properties to get the full error message seems painful, IMO errors should be obvious and in the users face.

Activity

  1. stephenplusplus commented on Sep 11, 2015

    @stephenplusplus
    Contributor

    That's a wrapped error. We don't know what the underlying error is, so instead of giving them something potentially cryptic, we wrap it to at least let the user know what failed. How could a custom error type solve that?

  2. callmehiphop commented on Sep 11, 2015

    @callmehiphop
    ContributorAuthor

    I think if the error name was descriptive enough then the user should be able to deduce what happened without having to access additional properties for more info.

    e.g.

    SigningError: Cryptic error message

    vs.

    Error: Signing failed, see error property for more info
    err.error // => Cryptic error message
    
  3. stephenplusplus commented on Sep 11, 2015

    @stephenplusplus
    Contributor

    I'd have to say, that makes a lot of sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions