[devtools] console doesn't handle 'unhandledrejection' events properly
Reported by
kaycebas...@gmail.com,
May 3 2017
|
||||||
Issue description
Chrome Version : 60.0.3087.0
OS Version: OS X 10.12.4
What steps will reproduce the problem?
Execute the following code in the Console:
window.onunhandledrejection = e => console.log('unhandled', e);
Promise.reject(1);
What is the expected result?
The Console logs "unhandled".
What happens instead of that?
The Console throws an uncaught exception.
UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3087.0 Safari/537.36
,
May 11 2017
Able to reproduce this issue on Windows 10, Ubuntu 14.04 and Mac 10.12.4 with chrome stable #58.0.3029.110 Canary #60.0.3095.0 and also observed in earlier version M30-30.0.1549.0 This is a non=regression issue, hence marking it as untriaged. Attaching a screenshot for reference.
,
May 16 2017
,
Jun 9 2017
,
Oct 16 2017
,
Dec 7 2017
You should preventDefault to avoid dumping message to console. window.onunhandledrejection = e => e.preventDefault(); Promise.reject(1); Right now it works only for scripts with url, I have fix under review to make it works for anonymous scripts as well [1]. [1] https://chromium-review.googlesource.com/c/chromium/src/+/815380
,
Dec 8 2017
Ok, it is intended behavior. Web platform sanitize some error events based on its source url and we need to sanitize events with empty source url as well. Unfortunately there is only one work around: evaluate your command in console with sourceURL: window.onunhandledrejection = e => e.preventDefault(); Promise.reject(1); //# sourceURL=foo.js We can revisit this one later when will collect more use cases where this behavior is harmful. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by ajha@chromium.org
, May 10 2017Labels: Needs-Triage-M60