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

Unified Diff: sdk/lib/_internal/pub/lib/src/utils.dart

Issue 68493003: Ensure that errors have stack traces attached. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | « sdk/lib/_internal/pub/lib/src/safe_http_server.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/utils.dart
diff --git a/sdk/lib/_internal/pub/lib/src/utils.dart b/sdk/lib/_internal/pub/lib/src/utils.dart
index dcbd520d2d2e3f09a7abe6d079d381ccfd7175bc..711b224cca4ee90d18d6d8bc4c14800a143a1c3e 100644
--- a/sdk/lib/_internal/pub/lib/src/utils.dart
+++ b/sdk/lib/_internal/pub/lib/src/utils.dart
@@ -64,11 +64,11 @@ class FutureGroup<T> {
completed = true;
_completer.complete(_values);
}
- }).catchError((e) {
+ }).catchError((e, stackTrace) {
if (completed) return;
completed = true;
- _completer.completeError(e);
+ _completer.completeError(e, stackTrace);
}));
return task;
@@ -292,8 +292,7 @@ String sha1(String source) {
/// Configures [future] so that its result (success or exception) is passed on
/// to [completer].
void chainToCompleter(Future future, Completer completer) {
- future.then((value) => completer.complete(value),
- onError: (e) => completer.completeError(e));
+ future.then(completer.complete, onError: completer.completeError);
}
/// Ensures that [stream] can emit at least one value successfully (or close
@@ -641,8 +640,8 @@ Future resetStack(fn()) {
// first and second cases described above.
newFuture(fn).then((val) {
scheduleMicrotask(() => completer.complete(val));
- }).catchError((err) {
- scheduleMicrotask(() => completer.completeError(err));
+ }).catchError((err, stackTrace) {
+ scheduleMicrotask(() => completer.completeError(err, stackTrace));
});
return completer.future;
}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/safe_http_server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698