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

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

Issue 16123036: Clean up dart:io exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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/process.dart ('k') | sdk/lib/io/socket.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 0db4e46d828b8361aa3a46aa123b5feca8dafc6b..05ec18cf4fe326d33f6f686cd9b5adafbbff2b6e 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -614,7 +614,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
List<int> read([int len]) {
if (_closedRead) {
- throw new SocketIOException("Reading from a closed socket");
+ throw new SocketException("Reading from a closed socket");
}
if (_status != CONNECTED) {
return null;
@@ -663,7 +663,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 SocketIOException("Writing to a closed socket"));
+ _controller.addError(new SocketException("Writing to a closed socket"));
return 0;
}
if (_status != CONNECTED) return 0;
@@ -750,7 +750,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
} else {
if (_status != CONNECTED) {
// Cannot happen.
- throw new SocketIOException("Internal SocketIO Error");
+ throw new SocketException("Internal SocketIO Error");
}
try {
_readEncryptedData();
@@ -783,12 +783,12 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
void _reportError(e, String message) {
// TODO(whesse): Call _reportError from all internal functions that throw.
- if (e is SocketIOException) {
- e = new SocketIOException('$message (${e.message})', e.osError);
+ if (e is SocketException) {
+ e = new SocketException('$message (${e.message})', e.osError);
} else if (e is OSError) {
- e = new SocketIOException(message, e);
+ e = new SocketException(message, e);
} else {
- e = new SocketIOException('$message (${e.toString()})', null);
+ e = new SocketException('$message (${e.toString()})', null);
}
if (_connectPending) {
_handshakeComplete.completeError(e);
@@ -811,7 +811,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
}
} else if (_status == HANDSHAKE) {
_reportError(
- new SocketIOException('Connection terminated during handshake'),
+ new SocketException('Connection terminated during handshake'),
'handshake error');
}
}
« no previous file with comments | « sdk/lib/io/process.dart ('k') | sdk/lib/io/socket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698