New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 602145 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Dec 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Debugger support for chained/rethrown errors

Reported by yaa...@gmail.com, Apr 11 2016

Issue description

UserAgent: 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
 
Owner: kozyatinskiy@chromium.org
Status: Assigned (was: Unconfirmed)
@kozyatinskiy: do you think stack tagging would work for this scenario? 
Status: Fixed (was: Assigned)
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