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

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

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebuild DOM and rebase. Created 7 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
Index: sdk/lib/io/http_parser.dart
diff --git a/sdk/lib/io/http_parser.dart b/sdk/lib/io/http_parser.dart
index 9a2f6b9bfdc0ed40b0ef93a7e71c6d95cd7b61bd..b7a70f541d09635e250bcb6078e02e2d7d8d6eda 100644
--- a/sdk/lib/io/http_parser.dart
+++ b/sdk/lib/io/http_parser.dart
@@ -123,7 +123,7 @@ class _HttpDetachedIncoming extends Stream<List<int>> {
}
StreamSubscription<List<int>> listen(void onData(List<int> event),
- {void onError(AsyncError error),
+ {void onError(error),
void onDone(),
bool unsubscribeOnError}) {
return controller.stream.listen(
@@ -216,7 +216,7 @@ class _HttpParser
StreamSubscription<_HttpIncoming> listen(void onData(_HttpIncoming event),
- {void onError(AsyncError error),
+ {void onError(error),
void onDone(),
bool unsubscribeOnError}) {
return _controller.stream.listen(onData,
@@ -681,7 +681,7 @@ class _HttpParser
}
} catch (e, s) {
_state = _State.FAILURE;
- error(new AsyncError(e, s));
+ error(e, s);
}
_parserCalled = false;
@@ -713,9 +713,8 @@ class _HttpParser
!(_state == _State.START && !_requestParser) &&
!(_state == _State.BODY && !_chunked && _transferLength == -1)) {
_bodyController.addError(
- new AsyncError(
- new HttpParserException(
- "Connection closed while receiving data")));
+ new HttpParserException(
+ "Connection closed while receiving data"));
}
_closeIncoming();
_controller.close();
@@ -724,10 +723,8 @@ class _HttpParser
// If the connection is idle the HTTP stream is closed.
if (_state == _State.START) {
if (!_requestParser) {
- error(
- new AsyncError(
- new HttpParserException(
- "Connection closed before full header was received")));
+ error(new HttpParserException(
+ "Connection closed before full header was received"));
}
_controller.close();
return;
@@ -742,10 +739,8 @@ class _HttpParser
_state = _State.FAILURE;
// Report the error through the error callback if any. Otherwise
// throw the error.
- error(
- new AsyncError(
- new HttpParserException(
- "Connection closed before full header was received")));
+ error(new HttpParserException(
+ "Connection closed before full header was received"));
_controller.close();
return;
}
@@ -756,10 +751,8 @@ class _HttpParser
_state = _State.FAILURE;
// Report the error through the error callback if any. Otherwise
// throw the error.
- error(
- new AsyncError(
- new HttpParserException(
- "Connection closed before full body was received")));
+ error(new HttpParserException(
+ "Connection closed before full body was received"));
}
_controller.close();
}
@@ -931,10 +924,10 @@ class _HttpParser
}
}
- void error(error) {
+ void error(error, [stackTrace]) {
if (_socketSubscription != null) _socketSubscription.cancel();
_state = _State.FAILURE;
- _controller.addError(error);
+ _controller.addError(error, stackTrace);
_controller.close();
}

Powered by Google App Engine
This is Rietveld 408576698