RESOLVED DUPLICATE of bug 150358 124066
Uncaught exceptions raised in promise completion functions are not printed to console
https://bugs.webkit.org/show_bug.cgi?id=124066
Summary Uncaught exceptions raised in promise completion functions are not printed to...
Alexey Proskuryakov
Reported 2013-11-08 13:15:57 PST
Created attachment 216429 [details] test case E.g. crypto.subtle.generateKey({name: "hmac", hash: "sha-1"}, true, ["sign", "verify"]).then(function(result) { throw("See me?"); }); Marking this as blocking WebCrypto, because it's super difficult to use WebCrypto form JS when uncaught exceptions are not visible in Inspector. In fact, this is even slowing down writing tests for me, even though I'm only targeting WebKit, and know what and when raises exceptions.
Attachments
test case (358 bytes, text/html)
2013-11-08 13:15 PST, Alexey Proskuryakov
no flags
another test case (314 bytes, text/html)
2013-12-02 16:57 PST, Alexey Proskuryakov
no flags
Alexey Proskuryakov
Comment 1 2013-12-02 16:57:39 PST
Created attachment 218241 [details] another test case A test case that doesn't use WebCrypto. What happens here is when JSPromiseWrapperCallback::callPromiseWrapperCallback() sees an exception, it immediately clears it, and invokes resolver's reject callback with the exception as argument. But when there are no reject callbacks registered, it's just dropped on the floor. Perhaps the exception shouldn't be cleared when there are no reject callbacks to handle it, and then JSGlobalObjectCallback could report it in the same way as other code that executes JS does. ScriptController::evaluateInWorld() and JSEventListener::handleEvent() seem like they could serve as models.
Joseph Pecoraro
Comment 2 2014-08-05 12:14:30 PDT
This sounds bad! The Web Inspector should know about all exceptions.
Radar WebKit Bug Importer
Comment 3 2014-08-05 12:14:38 PDT
Joseph Pecoraro
Comment 4 2016-12-12 18:48:08 PST
There is already some work in this area on bug 150358. With the HTML Spec's unhandledpromiserejection / rejectionhandled events.
Joseph Pecoraro
Comment 5 2017-04-27 20:37:48 PDT
This was addressed by: bug 150358 • The first test case is outdated (there is no Promise.fulfill anymore) • The second test case produces: [Error] Unhandled Promise Rejection: See me? *** This bug has been marked as a duplicate of bug 150358 ***
Note You need to log in before you can comment on or make changes to this bug.