-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Provide better tools to detect Errors at runtime #34060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This actually lines up well with our existing documentation on https://api.dartlang.org/dev/2.0.0-dev.69.5/dart-core/Error-class.html Specifically:
|
For DDT we already pause on Errors, e.g. RangeError. Are we talking about a change to errors where they're not throwing? It would be pretty easy to have DDC compile errors to include a "debugger" statement, possibly conditional. |
I meant differentiating between pausing on a Dart |
I wonder if having a debug mode flag to implicitly treat |
Yes, I think we want something like that - although perhaps catching everything except errors (e.g., plain Objects):
|
In general,
Error
objects aren't treated any differently fromException
objects - developers typically write code that can catch either:Given that our compilers can (under certain flags) assume that
Error
would not be thrown (see #34044), we should provide better support in our to detect when they occur at runtime during development and testing.E.g., DDC might provide (or default to) a mode where
Error
objects cannot be caught (accommodating for frameworks). DDT might provide a 'Pause on Error' option.@jmesserly @alan-knight @sigmundch
The text was updated successfully, but these errors were encountered: