-
Notifications
You must be signed in to change notification settings - Fork 112
Open
Description
It's a node-ism that the first parameter in a callback is an error, but it's also a nodeism that the first parameter is an instanceof Error. This allows user callback code to assume a standard API -- things like error.stack, error.message -- for actions like logging, analytics, etc.
https://github.com/robrighter/node-recurly/blob/master/lib/client.js#L86 is one instance where node-recurly does not pass Errors to the user callback for the error parameter, breaking any user code that assumes a standard Error api.
_wrap_response() can still set the .statusCode and .headers on the Error object, but it should return an instanceof Error if it's wrapping an error.
Metadata
Metadata
Assignees
Labels
No labels