Chromium Code Reviews| Index: sdk/lib/async/stream_controller.dart |
| diff --git a/sdk/lib/async/stream_controller.dart b/sdk/lib/async/stream_controller.dart |
| index 61d0ad8ea999f620c959d0a3598a498ea3643dd8..eb36698c43e68ce34936f9abd41efa8798e4ac1e 100644 |
| --- a/sdk/lib/async/stream_controller.dart |
| +++ b/sdk/lib/async/stream_controller.dart |
| @@ -85,10 +85,24 @@ class StreamController<T> extends Stream<T> implements StreamSink<T> { |
| /** |
| * Send or enqueue an error event. |
| * |
| + * If the [error] is an [AsyncError], it is used directly as the |
| + * error object reported to listeners, and the [stackTrace] is ignored. |
|
floitsch
2013/01/10 16:38:10
I would mention the special case after the normal
Lasse Reichstein Nielsen
2013/01/11 07:02:05
Done.
|
| + * |
| + * Otherwise the [exception] and an optional [stackTrace] is combined and sent |
| + * this stream's listeners. |
| + * |
| * If a subscription has requested to be unsubscribed on errors, |
| * it will be unsubscribed after receiving this event. |
| */ |
| - void signalError(AsyncError error) { _stream._signalError(error); } |
| + void signalError(Object error, [Object stackTrace]) { |
| + AsyncError asyncError; |
| + if (error is AsyncError) { |
| + asyncError = error; |
| + } else { |
| + asyncError = new AsyncError(error, stackTrace); |
| + } |
| + _stream._signalError(asyncError); |
| + } |
| /** |
| * Send or enqueue a "done" message. |