Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Trap on common errors #509

Open
vsmenon opened this issue Apr 19, 2016 · 2 comments
Open

Trap on common errors #509

vsmenon opened this issue Apr 19, 2016 · 2 comments
Assignees

Comments

@vsmenon
Copy link
Contributor

vsmenon commented Apr 19, 2016

The debugging experience, especially for large apps, is much better if we automatically trap on certain errors.

Catch on all exceptions doesn't seem to work well with Angular2 - they explicitly throw to record stack traces. One alternative is to make that work.

Another is to trap on explicit Dart errors (NullValue, NSM, Cast) - but this misses cases where we rely on the JS implementation to throw TypeErrors (null method or field).

@jmesserly
Copy link
Contributor

by "trap" do you mean "debugger;" statement?
http://www.ecma-international.org/ecma-262/6.0/#sec-debugger-statement

@jacob314
Copy link
Contributor

When
https://bugs.chromium.org/p/chromium/issues/detail?id=589980&q=component%3APlatform%3EDevTools%20pause&sort=-stars&colspec=ID%20Owner%20Summary%20Modified%20Stars
is fixed, chrome devtools will support this case via blackboxing and pause on all exceptions.

A right click to blackbox each script when you see it throw an error is all that is required.

Longer term there are two other options:

  1. Ask chrome devtools to support a pause on all exceptions with the ability to provide a filter on the exception object.
  2. Use the existing chrome functionality to track async stack traces instead of having dart code throw and catch to capture stack traces. Integrating with the existing chrome async stack trace functionality has the added benefit that inspection is supported on the async stack frames. This wouldn't solve all "applications catch and throw for spurious reasons" annoyances but would help a lot.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants