try {
buggyFunction();
} catch (exception) {
throw new MyCustomException(exception);
}
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
Thanks Günter. In my case I don't want to rethrow the same exception. I would like to throw a new custom exception and preserve the previous exception (the cause). Doing something like that is possible in other languages, such as PHP:
More specifically: would it be possible to add a new field (e.g., "attachment" or something) to stack_trace.Frame?So that we can call stack_trace.currentFrame.addAttachment(name, value)(because Frame can refer to async "stack frame", then there's no difference in API between async stack and normal stack).There's no removeAttachment. Attachment records will be (naturally) cleaned up when frame goes out of existence.
When stack trace is printed, attachments are printed automatically.I think it's a cool feature, really. It will eliminate a lot of nonsense like catching exception just to add stuff to it (java added special mechanism of suppressed exceptions in 1.7 for that purpose, but it's ugly anyway: you still have to catch and re-throw).
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.