-
Notifications
You must be signed in to change notification settings - Fork 16.2k
fix: reject the executeJavaScript promise when it fails to execute the script #18635
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
Conversation
Co-Authored-By: Jeremy Apthorp <nornagon@nornagon.net>
It's a bit silly that we can't get the actual error message, because it's totally possible to catch any error and transmit it back. This seems like a flaw in the API exposed by Chromium. Is there perhaps a different API we should be using for this? |
Co-Authored-By: Jeremy Apthorp <nornagon@nornagon.net>
@nornagon It eventually ends up here --> https://cs.chromium.org/chromium/src/third_party/blink/renderer/bindings/core/v8/script_controller.cc?type=cs&sq=package:chromium&g=0&l=90-145 Where the script is evaluated inside a try catch 🤔 |
Release Notes Persisted
|
@MarshallOfSound should we backport this to 6 at least? |
promise_.RejectWithErrorMessage( | ||
"Script failed to execute, this normally means an error " | ||
"was thrown. Check the renderer console for the error." | ||
"was thrown, check the renderer console for the error"); |
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.
This is here twice.
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.
How strange 😕 I definitely wouldn't type the same thing twice, the auto-formatter might have done this 🤔
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.
i think it's because you directly committed my suggestion in the github UI, which can't handle suggesting changing multiple lines
/trop run backport-to 6-0-x |
The backport process for this PR has been manually initiated, |
I have automatically backported this PR to "6-0-x", please check out #18714 |
Unfortunately we cannot get more information from Electron with regards to the nature of the error. In fact, the error that it reports instructs the user to check the JavaScript console within the renderer for more details. You can see more information here: electron/electron#18635 electron/electron#9102
Unfortunately we cannot get more information from Electron with regards to the nature of the error. In fact, the error that it reports instructs the user to check the JavaScript console within the renderer for more details. You can see more information here: electron/electron#18635 electron/electron#9102
Unfortunately we cannot get more information from Electron with regards to the nature of the error. In fact, the error that it reports instructs the user to check the JavaScript console within the renderer for more details. You can see more information here: electron/electron#18635 electron/electron#9102
Unfortunately we cannot get more information from Electron with regards to the nature of the error. In fact, the error that it reports instructs the user to check the JavaScript console within the renderer for more details. For more information, see: electron/electron#18635 electron/electron#9102 Fixes #30.
Unfortunately we cannot get more information from Electron with regards to the nature of the error. In fact, the error that it reports instructs the user to check the JavaScript console within the renderer for more details. For more information, see: electron/electron#18635 electron/electron#9102 Fixes #30.
Closes #9102
Unfortunately we can't get the actual error message, but can at least reject the promise to avoid leaving it dangling. The best we can do is tell them that their script failed, but not why.
Notes:
.executeJavaScript
will never leave a promise dangling now, scripts that fail to execute will correctly be rejected