-
Notifications
You must be signed in to change notification settings - Fork 232
Log exceptions/stack traces "nicer" in the browser #1367
Comments
yeah I think this sounds like a request for DDC + Dart2Js to expose a method in |
I think we could use It's not clear what we should do for "long" stack traces, though. |
The console methods (https://api.dartlang.org/dev/2.0.0-dev.59.0/dart-html/Console-class.html) take objects, not just strings. If you log the error directly (instead of stringifying it), do you get a better / inspectable trace? |
@vsmenon It's actually much worse when I do that: window.console.error(exception); And when I try the window.console.error(stack); ... not any better. I think this might be blocked at the DDC-level, since this looks fine in Dart2JS. |
Matan - it looks like you don't have custom formatters enabled in Chrome Dev Tools. (Unfortunately, we can't automatically turn that on.) |
Here is the link I looked up to enable it: |
That sounds reasonable to me. @kwalrath, WDYT? |
The only issue is where we should tell people about this. Although we can say something in Getting Started, it'll lack context. (Still, we could have a Tip box that links to elsewhere for more information.) We plan to add a doc about debugging with DDC... that's probably where it makes sense to have the full story. I'll put this on my list of things to discuss. |
It looks like it's enabled by default when using https://github.com/dart-lang/devtools-frontend . However not sure about the status and when we can use it. |
@eredo Not yet, because I don't believe the "long" (async) stack traces will work. |
No action. |
Still not able to 'correctly' log errors and stack traces. Are you planning to fix it ? |
(Internal bug is b/79354007.)
An internal customer writes:
https://github.com/dart-lang/angular/blob/0bb611387d29d65b5af7f9d2515ab571fd3fbee4/angular/lib/src/platform/browser/exceptions.dart#L13-L19
... I agree here. Here is an example of the console output of:
Notice that, as the user explained, the stack trace is just plain text.
Compare it with an example of errors thrown outside of AngularDart:
... err actually this is even worse. Maybe this is a regression externally/fixed internally?
(/cc @natebosch @jakemac53 - should we track this in
dart-lang/build
or DDC @vsmenon?)OK, here is that same basic (
throw new Error()
) program run with Dart2JS externally:... with the exception of being minified (intentional), notice that:
We should be able to get that same experience, by default, for DDC + AngularDart.
The text was updated successfully, but these errors were encountered: