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

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

Issue 66603002: Improve the HTTP client error when the provided URI is not suitable (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 1 month 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 | « no previous file | tests/standalone/io/http_client_exception_test.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 07ef4fe063f389209ade364ccb24a22047b4a981..458333d3475d6d05bb43804d600e0bd42901e3ad 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -1578,9 +1578,11 @@ class _HttpClient implements HttpClient {
throw new ArgumentError(method);
}
if (method != "CONNECT") {
- if (uri.host.isEmpty ||
- (uri.scheme != "http" && uri.scheme != "https")) {
- throw new ArgumentError("Unsupported scheme '${uri.scheme}' in $uri");
+ if (uri.host.isEmpty) {
+ throw new ArgumentError("No host specified in URI $uri");
+ } else if (uri.scheme != "http" && uri.scheme != "https") {
+ throw new ArgumentError(
+ "Unsupported scheme '${uri.scheme}' in URI $uri");
}
}
« no previous file with comments | « no previous file | tests/standalone/io/http_client_exception_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698