Index: lib/core/future.dart |
diff --git a/lib/core/future.dart b/lib/core/future.dart |
index 6b2fa19e3e82b3c5abb094af4f21570117fab0a5..e4ab4cd107b68c48ff542735014a830bd91cdd1f 100644 |
--- a/lib/core/future.dart |
+++ b/lib/core/future.dart |
@@ -123,6 +123,23 @@ interface Future<T> default FutureImpl<T> { |
* chain, and any you add afterwards will not be invoked. |
*/ |
Future chain(Future transformation(T value)); |
+ |
+ /** |
+ * A future representing [transformation] applied to this future's exception. |
+ * This can be used to "catch" an exception coming from `this` and translate |
+ * it to a more appropriate exception which will then be sent to the |
+ * returned future. |
+ * |
+ * If this future gets a value, it simply completes to that same value. If an |
+ * exception occurs, then [transformation] will be called with the exception |
+ * value. |
+ * |
+ * If [transformation] itself throws an exception, then the returned future |
+ * completes with that exception. If it returns `true`, then the exception is |
+ * considered handled and is not propagated to the returned future. If it |
+ * returns anything else, the original exception will be propagated. |
Siggi Cherem (dart-lang)
2012/09/04 20:17:52
thinking about the control flow of this and how si
Bob Nystrom
2012/09/04 21:14:43
Works for me. Done.
|
+ */ |
+ Future transformException(bool transformation(Object exception)); |
nweiz
2012/09/04 20:26:14
It seems like this should just be the default beha
Bob Nystrom
2012/09/04 21:14:43
I'm trying to keep this change as minimally invasi
nweiz
2012/09/04 21:35:35
Sure, seems fine.
|
} |