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

Unified Diff: runtime/bin/http_impl.dart

Issue 9699017: Start better error reporting for sockets (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added tests Created 8 years, 9 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: runtime/bin/http_impl.dart
diff --git a/runtime/bin/http_impl.dart b/runtime/bin/http_impl.dart
index e5844f46de7cc15c8d15c7ed77f497abf249c037..b79a2cfcd9e0722ff12745fb1ef6e4294a6c21fb 100644
--- a/runtime/bin/http_impl.dart
+++ b/runtime/bin/http_impl.dart
@@ -509,11 +509,11 @@ class _HttpConnectionBase implements Hashable {
if (_onDisconnectCallback != null) _onDisconnectCallback();
}
- void _onError() {
+ void _onError(Exception e) {
// If an error occours, treat the socket as closed.
_onClosed();
if (_onErrorCallback != null) {
- _onErrorCallback("Connection closed while sending data to client.");
+ _onErrorCallback("Connection closed while sending data to client ($e).");
}
}
@@ -1070,7 +1070,7 @@ class _HttpClient implements HttpClient {
_activeSockets.add(socketConn);
_connectionOpened(socketConn, connection);
};
- socket.onError = () {
+ socket.onError = (Exception e) {
if (_onError !== null) {
_onError(HttpStatus.NETWORK_CONNECT_TIMEOUT_ERROR);
Mads Ager (google) 2012/03/14 12:51:51 Do interpolation as above? Or doens't it make sens
Søren Gjesse 2012/03/19 10:05:43 For some odd reason this onError currently takes a
}
« no previous file with comments | « runtime/bin/dartutils.cc ('k') | runtime/bin/io.dart » ('j') | runtime/bin/io.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698