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

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: Rebuild DOM and rebase. 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
Index: sdk/lib/io/secure_socket.dart
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index c5fe3c2290befce7aa4df18329b5179193a77414..88f51c58b49bcb9b22da7914f47227f27743402f 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -288,7 +288,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
}
StreamSubscription listen(void onData(RawSocketEvent data),
- {void onError(AsyncError error),
+ {void onError(error),
void onDone(),
bool unsubscribeOnError}) {
if (_writeEventsEnabled) {
@@ -464,8 +464,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;
@@ -567,12 +566,9 @@ 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) {
+ if (e is SocketIOException) {
e = new SocketIOException('$message (${error.message})', error.osError);
} else if (error is OSError) {
e = new SocketIOException(message, error);

Powered by Google App Engine
This is Rietveld 408576698