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

Unified Diff: corelib/src/implementation/future_implementation.dart

Issue 10701084: Properly capture and pass the stack trace in Future exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: corelib/src/implementation/future_implementation.dart
diff --git a/corelib/src/implementation/future_implementation.dart b/corelib/src/implementation/future_implementation.dart
index 21ee08f26d01b5118749cc8b4ed67c1b0c838c85..9b6c12c80a05a1224a074f91e67213c84d366e21 100644
--- a/corelib/src/implementation/future_implementation.dart
+++ b/corelib/src/implementation/future_implementation.dart
@@ -172,14 +172,14 @@ class FutureImpl<T> implements Future<T> {
Future transform(Function transformation) {
final completer = new Completer();
handleException((e) {
- completer.completeException(e);
+ completer.completeException(e, this.stackTrace);
return true;
});
then((v) {
var transformed = null;
try {
transformed = transformation(v);
- } catch (final ex, final stackTrace) {
+ } catch (Exception ex, final stackTrace) {
Siggi Cherem (dart-lang) 2012/07/03 19:13:46 weird, why is this needed? what if it was 'var' or
nweiz 2012/07/03 21:39:26 With "var" or "final", the stack trace isn't captu
Siggi Cherem (dart-lang) 2012/07/03 22:10:06 weird... if you haven't already, file a bug on the
completer.completeException(ex, stackTrace);
return;
}
@@ -191,19 +191,19 @@ class FutureImpl<T> implements Future<T> {
Future chain(Function transformation) {
final completer = new Completer();
handleException((e) {
- completer.completeException(e);
+ completer.completeException(e, this.stackTrace);
return true;
});
then((v) {
var future = null;
try {
future = transformation(v);
- } catch (final ex, final stackTrace) {
+ } catch (Exception ex, final stackTrace) {
completer.completeException(ex, stackTrace);
return;
}
future.handleException((e) {
- completer.completeException(e);
+ completer.completeException(e, this.stackTrace);
return true;
});
future.then((b) => completer.complete(b));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698