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

Unified Diff: runtime/bin/stream_util.dart

Issue 10173024: Change the error handling in dart:io (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 | « runtime/bin/socket_stream_impl.dart ('k') | runtime/bin/string_stream.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/stream_util.dart
diff --git a/runtime/bin/stream_util.dart b/runtime/bin/stream_util.dart
index 8c9a2b083af71655d0d20471f40fd60d6837430b..efc2f82411395bf042364c8deca19f56d3ba3ce0 100644
--- a/runtime/bin/stream_util.dart
+++ b/runtime/bin/stream_util.dart
@@ -53,7 +53,7 @@ class _BaseDataInputStream {
_checkScheduleCallbacks();
}
- void set onError(void callback(Exception e)) {
+ void set onError(void callback(e)) {
_clientErrorHandler = callback;
}
@@ -186,4 +186,18 @@ class _BaseOutputStream {
}
return true;
}
+
+ void set onError(void callback(e)) {
+ _onError = callback;
+ }
+
+ void _reportError(e) {
+ if (_onError != null) {
+ _onError(e);
+ } else {
+ throw e;
+ }
+ }
+
+ Function _onError;
}
« no previous file with comments | « runtime/bin/socket_stream_impl.dart ('k') | runtime/bin/string_stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698