Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document error handling #225

Open
ewandennis opened this issue Oct 30, 2017 · 0 comments
Open

Document error handling #225

ewandennis opened this issue Oct 30, 2017 · 0 comments

Comments

@ewandennis
Copy link
Contributor

ewandennis commented Oct 30, 2017

Is it useful to identify errors by source in catch clauses. One common solution is to emit subclasses of Error. Another is to fill an identifying field on the error object. Either way, the chosen option should be a documented part of the client's interface.

node-sparkpost currently produces error instances with error.name === 'SparkPostError.

A few options:
[ ] - Publish the .name === SparkPostError for error filtering.
[ ] - Subclass Error to create a SparkPostError type.

We could also do both...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant