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
fix: errors thrown in functions over the contextBridge
#28346
Conversation
9b05e4a
to
99060a8
Compare
99060a8
to
c8d9ce9
Compare
Release Notes Persisted
|
I was unable to backport this PR to "11-x-y" cleanly; |
I was unable to backport this PR to "12-x-y" cleanly; |
I was unable to backport this PR to "13-x-y" cleanly; |
@codebytere has manually backported this PR to "13-x-y", please check out #28446 |
@codebytere has manually backported this PR to "12-x-y", please check out #28447 |
Description of Change
Closes #28327.
Fixes an issue where errors thrown in functions passed over the
contextBridge
would be prefixed withUncaught Error
so that the error message then incorrectly displayed asError: Uncaught Error: test
. This is owed to the fact that errors aren't serializable as-is, so we should be pulling the message off the exception and re-constructing and throwing it in the destination contextTested with https://gist.github.com/f11c77f9bc2cbf98d42a9fcaf477c80a.
Checklist
npm test
passesRelease Notes
Notes: Fixed an issue where errors thrown in functions passed over the
contextBridge
could be displayed incorrectly.