New issue
Advanced search Search tips

Issue 718077 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

[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



 

Comment 1 by ajha@chromium.org, May 10 2017

Components: Platform>DevTools
Labels: Needs-Triage-M60
Cc: kkaluri@chromium.org
Labels: -Needs-Triage-M60 M60 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
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.
Issue 718077.png
104 KB View Download
Owner: kozyatinskiy@chromium.org
Status: Assigned (was: Untriaged)
Labels: -M60 M-60
Owner: kozy@chromium.org

Comment 6 by kozy@chromium.org, 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

Comment 7 by kozy@chromium.org, Dec 8 2017

Status: WontFix (was: Assigned)
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