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

Unified Diff: runtime/bin/http_impl.dart

Issue 10315010: Better checking and error reporting for HTTP client (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/http_impl.dart
diff --git a/runtime/bin/http_impl.dart b/runtime/bin/http_impl.dart
index 836a9439d908bf48431a1a58f538cc309e581166..96d4373b2f8b994a8aae25c00bdf45f5c22ffaec 100644
--- a/runtime/bin/http_impl.dart
+++ b/runtime/bin/http_impl.dart
@@ -1262,6 +1262,8 @@ class _HttpClientConnection
if (e != null) {
if (_onErrorCallback != null) {
_onErrorCallback(e);
+ } else {
+ throw e;
}
}
_closing = true;
@@ -1366,6 +1368,9 @@ class _HttpClient implements HttpClient {
HttpClientConnection open(
String method, String host, int port, String path) {
if (_shutdown) throw new HttpException("HttpClient shutdown");
+ if (method == null || host == null || port == null || path == null) {
+ throw new NullPointerException();
Mads Ager (google) 2012/05/03 13:36:28 We could throw a more descriptive error here? Not
Søren Gjesse 2012/05/07 11:42:31 Changed to IllegalArgumentException. Arguments ar
+ }
return _prepareHttpClientConnection(host, port, method, path);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698