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

Unified Diff: sdk/lib/io/secure_socket.dart

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 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 | « sdk/lib/io/secure_server_socket.dart ('k') | sdk/lib/io/stdio.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/secure_socket.dart
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index e61faa5b6e80ec80a8a1ab9967de1b566ccf5010..b887601e376f34c2319d807adec8f4586d7baf96 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -290,7 +290,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
}
StreamSubscription listen(void onData(RawSocketEvent data),
- {void onError(AsyncError error),
+ {void onError(error),
void onDone(),
bool cancelOnError}) {
if (_writeEventsEnabled) {
@@ -466,8 +466,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
// up handlers to flush the pipeline when possible.
int write(List<int> data, [int offset, int bytes]) {
if (_closedWrite) {
- _controller.addError(new AsyncError(new SocketIOException(
- "Writing to a closed socket")));
+ _controller.addError(new SocketIOException("Writing to a closed socket"));
return 0;
}
if (_status != CONNECTED) return 0;
@@ -569,17 +568,14 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
_reportError(e, 'Error on underlying RawSocket');
}
- void _reportError(error, String message) {
+ void _reportError(e, String message) {
// TODO(whesse): Call _reportError from all internal functions that throw.
- var e;
- if (error is AsyncError) {
- e = error;
- } else if (error is SocketIOException) {
- e = new SocketIOException('$message (${error.message})', error.osError);
+ if (e is SocketIOException) {
+ e = new SocketIOException('$message (${e.message})', e.osError);
} else if (error is OSError) {
- e = new SocketIOException(message, error);
+ e = new SocketIOException(message, e);
} else {
- e = new SocketIOException('$message (${error.toString()})', null);
+ e = new SocketIOException('$message (${e.toString()})', null);
}
if (_connectPending) {
_handshakeComplete.completeError(e);
« no previous file with comments | « sdk/lib/io/secure_server_socket.dart ('k') | sdk/lib/io/stdio.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698