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

Unified Diff: sdk/lib/_internal/pub/lib/src/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: Address comments. 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
Index: sdk/lib/_internal/pub/lib/src/safe_http_server.dart
diff --git a/sdk/lib/_internal/pub/lib/src/safe_http_server.dart b/sdk/lib/_internal/pub/lib/src/safe_http_server.dart
index 63b7705a75c5f635cb7f4d08d81ab2cf5458e56c..ba6d8778f58847b1913b0b7a6a25ac1f7652cdfe 100644
--- a/sdk/lib/_internal/pub/lib/src/safe_http_server.dart
+++ b/sdk/lib/_internal/pub/lib/src/safe_http_server.dart
@@ -52,12 +52,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(),
nweiz 2013/10/07 18:49:51 No space before "Function"
floitsch 2013/10/10 14:22:52 Done.
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.
@@ -67,7 +67,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;
}

Powered by Google App Engine
This is Rietveld 408576698