-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Never mutate user errors #154
Conversation
Codecov Report
@@ Coverage Diff @@
## master #154 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 4 4
Lines 147 153 +6
Branches 44 45 +1
=====================================
+ Hits 147 153 +6
Continue to review full report at Codecov.
|
7766d92
to
5b99654
Compare
5b99654
to
5ec27fb
Compare
5ec27fb
to
f5d8863
Compare
Could there be a way to disable adding context/code to the error completely? For example, I log errors to a service and have to delete these properties before sending. |
@frenzzy thanks for the feedback. #152 looks like a good solution to me, and provides the context incase you want it.
|
Some libraries freezes an error object before rejection (
Object.freeze(err)
). Because code which addscontext
andcode
to the error object throws an exception, the router unable to call error handler and some exceptions may become unhandled.Solution: never mutate third-party error object.
ref #152