Index: lib/core/future.dart |
diff --git a/lib/core/future.dart b/lib/core/future.dart |
index 6b2fa19e3e82b3c5abb094af4f21570117fab0a5..db238ec4057dcded2d97b9be96ee50220c7586e3 100644 |
--- a/lib/core/future.dart |
+++ b/lib/core/future.dart |
@@ -104,8 +104,16 @@ interface Future<T> default FutureImpl<T> { |
* |
* You must not add exception handlers to [this] future prior to calling |
* transform, and any you add afterwards will not be invoked. |
+ * |
+ * The [onException] parameter can be provided to control how exceptions |
+ * received by this future or the transformation are handled. If an exception |
+ * occures, [onException] will be called. If that throws an exception, the |
+ * returned future will complete with that exception. If it returns `true`, |
+ * then the exception is considered handled and is not propogated to the |
+ * returned future. If it returns anything else, the original exception will |
+ * be propogated. |
*/ |
- Future transform(transformation(T value)); |
+ Future transform(transformation(T value), [onException(Object exception)]); |
Siggi Cherem (dart-lang)
2012/09/04 16:56:33
maybe use [bool onException(Object exception)]?
(a
|
/** |
* A future representing an asynchronous transformation applied to this |