Chromium Code Reviews| Index: lib/core/future.dart |
| diff --git a/lib/core/future.dart b/lib/core/future.dart |
| index 99af2415180efcd019af18bce4ad6a7800ef087b..ea395491141149aced37fdb6ab0e4437d01a72e1 100644 |
| --- a/lib/core/future.dart |
| +++ b/lib/core/future.dart |
| @@ -193,6 +193,22 @@ class FutureAlreadyCompleteException implements Exception { |
| String toString() => "Exception: future already completed"; |
| } |
| +/** |
| + * Wraps unhandled exceptions provided to [Completer.completeException]. It is |
| + * used to show both the error message and the stack trace for unhandled |
| + * exceptions. |
| + */ |
| +class FutureUnhandledException implements Exception { |
| + /** Wrapped exception. */ |
| + var source; |
| + |
| + /** Trace for the wrapped exception. */ |
| + var stackTrace; |
| + |
| + FutureUnhandledException(this.source, this.stackTrace); |
|
Jennifer Messerly
2012/10/19 23:54:15
nit: newline after this
|
| + String toString() => "$source\n$stackTrace".replaceAll('\n','\n '); |
|
Jennifer Messerly
2012/10/19 23:54:15
include more context here? maybe something like:
|
| +} |
| + |
| /** |
| * [Futures] holds additional utility functions that operate on [Future]s (for |