Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Unified Diff: sdk/lib/async/stream_impl.dart

Issue 555153002: Add error-intercept for Completer.completeError and StreamController.addError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Intercept all errors thrown by unregistered callbacks. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/async/stream_controller.dart ('k') | sdk/lib/async/stream_pipe.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/stream_impl.dart
diff --git a/sdk/lib/async/stream_impl.dart b/sdk/lib/async/stream_impl.dart
index 20314c88a17d5170ab621f7ea4ce5d5ce4a46823..394e1c6a7c72b51b25fc7df35554941a94e2e2e5 100644
--- a/sdk/lib/async/stream_impl.dart
+++ b/sdk/lib/async/stream_impl.dart
@@ -1008,9 +1008,10 @@ class _StreamIteratorImpl<T> implements StreamIterator<T> {
_subscription.resume();
return new _Future<bool>.immediate(true);
case _STATE_EXTRA_ERROR:
- Object prefetch = _futureOrPrefetch;
+ AsyncError prefetch = _futureOrPrefetch;
_clear();
- return new _Future<bool>.immediateError(prefetch);
+ return new _Future<bool>.immediateError(prefetch.error,
+ prefetch.stackTrace);
case _STATE_EXTRA_DONE:
_clear();
return new _Future<bool>.immediate(false);
@@ -1063,7 +1064,7 @@ class _StreamIteratorImpl<T> implements StreamIterator<T> {
}
_subscription.pause();
assert(_futureOrPrefetch == null);
- _futureOrPrefetch = error;
+ _futureOrPrefetch = new AsyncError(error, stackTrace);
_state = _STATE_EXTRA_ERROR;
}
« no previous file with comments | « sdk/lib/async/stream_controller.dart ('k') | sdk/lib/async/stream_pipe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698