Matan Lurey
2017-01-27 00:35:38 UTC
AngularDart currently has the concept of a *WrappedException
<https://github.com/dart-lang/angular2/blob/master/lib/src/facade/exceptions.dart#L18>.*
Basically, it's a framework-level *Exception* that wraps another; we use it
for example to capture an exception that occurs in user-code but expose why
the exception was caused where it was caused, for example,
*ViewWrappedException
<https://github.com/dart-lang/angular2/blob/2f5ba45a83ecd29ab2ee407890c2e03cd3c2e59e/lib/src/core/linker/exceptions.dart#L46>*
.
Basically, there is code like
try {
runUserCode();
} catch (e, s) {
throw new WrappedException(e, s, context: 'View instantiation');
}
Is there a better strategy for doing this or any known libraries or
patterns for this type of error/exception encapsulation?
~ Matan
<https://github.com/dart-lang/angular2/blob/master/lib/src/facade/exceptions.dart#L18>.*
Basically, it's a framework-level *Exception* that wraps another; we use it
for example to capture an exception that occurs in user-code but expose why
the exception was caused where it was caused, for example,
*ViewWrappedException
<https://github.com/dart-lang/angular2/blob/2f5ba45a83ecd29ab2ee407890c2e03cd3c2e59e/lib/src/core/linker/exceptions.dart#L46>*
.
Basically, there is code like
try {
runUserCode();
} catch (e, s) {
throw new WrappedException(e, s, context: 'View instantiation');
}
Is there a better strategy for doing this or any known libraries or
patterns for this type of error/exception encapsulation?
~ Matan
--
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+***@dartlang.org.
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+***@dartlang.org.