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

Unified Diff: sdk/lib/io/http_impl.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/http.dart ('k') | sdk/lib/io/http_parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_impl.dart
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index e8f35a3c3c99f79263596ab59f3f1c0b131ddff3..5edcbbf418bcdfc667290740ce4f7b275dcc3b38 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -216,7 +216,7 @@ class _HttpClientResponse
for (var redirect in redirects) {
if (redirect.location == url) {
return new Future.error(
- new RedirectLoopException(redirects));
+ new RedirectException("Redirect loop detected", redirects));
}
}
}
@@ -573,7 +573,7 @@ class _HttpOutboundConsumer implements StreamConsumer {
},
onError: (error) {
_socketError = true;
- if (error is SocketIOException &&
+ if (error is SocketException &&
_outbound is HttpResponse) {
_cancel();
_done();
@@ -894,7 +894,8 @@ class _HttpClientRequest extends _HttpOutboundMessage<HttpClientResponse>
// End with exception, too many redirects.
future = response.drain()
.then((_) => new Future.error(
- new RedirectLimitExceededException(response.redirects)));
+ new RedirectException("Redirect limit exceeded",
+ response.redirects)));
}
} else if (response._shouldAuthenticateProxy) {
future = response._authenticate(true);
@@ -1227,10 +1228,8 @@ class _HttpClientConnection {
})
// If we see a state error, we failed to get the 'first'
// element.
- // Transform the error to a HttpParserException, for
- // consistency.
.catchError((error) {
- throw new HttpParserException(
+ throw new HttpException(
"Connection closed before data was received");
}, test: (error) => error is StateError)
.catchError((error) {
« no previous file with comments | « sdk/lib/io/http.dart ('k') | sdk/lib/io/http_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698