node-sparkpost
node-sparkpost copied to clipboard
Document error handling
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...