-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
Feat: add more information to serializeError #16682
Conversation
// Error.prototype.toString() does not include custom property `code` | ||
toString() { | ||
return `${this.name} (code: ${this.code}): ${this.message}`; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Error.prototype.toString returns only ${this.name}: ${this.message}
, but code
is an important info for debug (see definition above in this file)
bc60a9a
to
826002e
Compare
Notes for context for anyone very curious about Javascript + Jest error handling internals: I tried this, but with no effect, because this is just an initial state, it gets rewritten by
So I tried this. In Jest you can mock almost anything. But not
You can play with this in Firefox browser console. In Chrome, the override still does not take effect. Interesting! 🤔
|
Description
Followup to #16652
stackTrace
to the new utilserializeError
.toString()
onTrezorError
(a.k.a.TypedError
)Error.prototype.toString()
which omits the very importantcode
propertyℹ️ when sending the error to sentry, it might get clipped. Different sources say different max size so idk, but it's typically the beginning of stack trace that's most pertinent.
Related Issue
Resolve #16584 (followup)
Logs:
This can be tested with the FW hash check.
I placed
throw ERRORS.TypedError('Runtime', 'Mock Error Description')
at this line.Looking into redux
state.device.selectedDevice.authenticityChecks.firmwareHash.errorPayload
:Desktop:
Web: