-
Notifications
You must be signed in to change notification settings - Fork 9
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
Deprecate errcode(String, ...)
#19
Comments
I agree! Let’s remove the support for it as a breaking change and bump the major. Wanna do a PR? |
achingbrain
added a commit
to achingbrain/js-err-code
that referenced
this issue
Jul 12, 2019
If other types are passed in, a new `Error` object is created by this module which results in misleading stack traces. Closes IndigoUnited#19
Done! See #20 |
achingbrain
added a commit
to achingbrain/js-err-code
that referenced
this issue
Jul 15, 2019
If other types are passed in, a new `Error` object is created by this module which results in misleading stack traces. Closes IndigoUnited#19
achingbrain
added a commit
to achingbrain/js-err-code
that referenced
this issue
Jul 15, 2019
If other types are passed in, a new `Error` object is created by this module which results in misleading stack traces. Closes IndigoUnited#19
satazor
pushed a commit
that referenced
this issue
Jul 15, 2019
If other types are passed in, a new `Error` object is created by this module which results in misleading stack traces. Closes #19
Hi there ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you pass a string as the first argument, this module will new up an
Error
for us, which is convenient and all but means the stack trace for the error starts in theerr-code
module and not at the throw site.This leads to developer confusion as there are irrelevant lines in the stack trace, and also leaks internal implementation details of the calling code (e.g. that
err-code
is used) which seems like an anti-pattern.Accepting a string as the first argument should be deprecated and removed in a future release in favour of passing in
Error
objects.What do you think?
The text was updated successfully, but these errors were encountered: