You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat!: use .name property for errors instead of .code (#315)
Refactors thrown errors to have a `.name` property that describes the type of error, e.g. `NotFoundError` instead of a `.code` property like `ERR_NOT_FOUND`.
This is more ideomatic JavaScript as `.code` is largely inherited from errors thrown by Node.js's fs module whereas `.name` reflects the [function (e.g. constructor) name](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name) of the error.
Also removes the `err-code` dependency which is another CJS dep down.
BREAKING CHANGE: To detect the type of error thrown, use `.name` instead of `.code`
0 commit comments