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

Unified Diff: pkg/http/test/safe_http_server.dart

Issue 25094002: Adapt streams for additional stackTrace argument. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove types in closures. Created 7 years, 2 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 | « pkg/http/lib/src/utils.dart ('k') | pkg/http_server/lib/src/http_multipart_form_data_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/test/safe_http_server.dart
diff --git a/pkg/http/test/safe_http_server.dart b/pkg/http/test/safe_http_server.dart
index e55834c167c17af2471c50152e0900de8ef1ee64..8ce094f4b603bde9d539bb962e4ac5a17455db43 100644
--- a/pkg/http/test/safe_http_server.dart
+++ b/pkg/http/test/safe_http_server.dart
@@ -41,12 +41,12 @@ class SafeHttpServer extends StreamView<HttpRequest> implements HttpServer {
HttpConnectionsInfo connectionsInfo() => _inner.connectionsInfo();
StreamSubscription<HttpRequest> listen(void onData(HttpRequest value),
- {void onError(error), void onDone(),
+ {Function onError, void onDone(),
bool cancelOnError: false}) {
var subscription;
subscription = super.listen((request) {
onData(new _HttpRequestWrapper(request));
- }, onError: (error) {
+ }, onError: (error, StackTrace stackTrace) {
// Ignore socket error 104, which is caused by a request being cancelled
// before it writes any headers. There's no reason to care about such
// requests.
@@ -56,7 +56,13 @@ class SafeHttpServer extends StreamView<HttpRequest> implements HttpServer {
// Manually handle cancelOnError so the above (ignored) errors don't
// cause unsubscription.
if (cancelOnError) subscription.cancel();
- if (onError != null) onError(error);
+ if (onError != null) {
+ if (onError is ZoneBinaryCallback) {
+ onError(error, stackTrace);
+ } else {
+ onError(error);
+ }
+ }
}, onDone: onDone);
return subscription;
}
« no previous file with comments | « pkg/http/lib/src/utils.dart ('k') | pkg/http_server/lib/src/http_multipart_form_data_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698