Debugger support for chained/rethrown errors
Reported by
yaa...@gmail.com,
Apr 11 2016
|
||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36 Steps to reproduce the problem: It's common in JS to be catching and rethrowing exceptions—it's the only way to conditionally catch a certain type of Error, for instance. However, the debugger only lets you inspect the stack of the currently thrown Error, and not any previously caught Error. It would be amazing if the debugger could support nested / chained exceptions. It appears that Developer Tools already have this capability as demonstrated with the (much fancier) async debugging facilities. What is the expected behavior? There are obviously many design questions relevant here. For starters, how many caught errors should be retained? (There could have been many over the lifetime of the page, and it's not in the spirit of this user story to be asking for them all to be retained—though I think a similar question exists for async stack traces.) What went wrong? Currently one cannot actually switch the stack frame inspector to the stack frames from prior exceptions. Did this work before? N/A Chrome version: 49.0.2623.110 Channel: n/a OS Version: OS X 10.10.5 Flash Version: Shockwave Flash 21.0 r0
,
Dec 2 2016
function foo() {
throw new Error();
}
function boo() {
try { foo() } catch(e) { throw e; }
}
function main() {
try { boo() } catch(e) { throw e; }
}
main();
It will dump following stack in console:
Uncaught Error
foo @ boo.js:2
boo @ boo.js:6
main @ boo.js:10
(anonymous) @ boo.js:13
and error.stack will contain following:
Uncaught Error
at foo (boo.js:2)
at boo (boo.js:6)
at main (boo.js:10)
at boo.js:13
So it looks like fixed, feel free to open new issue if it's still a problem.
|
||
►
Sign in to add a comment |
||
Comment 1 by lushnikov@chromium.org
, Apr 11 2016Status: Assigned (was: Unconfirmed)