Index: pkg/scheduled_test/lib/src/schedule_error.dart |
diff --git a/pkg/scheduled_test/lib/src/schedule_error.dart b/pkg/scheduled_test/lib/src/schedule_error.dart |
index 910e4f5fcbaa03d76b9e83caa7779b90e4841aa5..264a0aab8e6afa1204ca4dec6bf42b55fcce9d7d 100644 |
--- a/pkg/scheduled_test/lib/src/schedule_error.dart |
+++ b/pkg/scheduled_test/lib/src/schedule_error.dart |
@@ -47,11 +47,10 @@ class ScheduleError { |
{StackTrace stackTrace}) { |
if (error is ScheduleError) return error; |
- var attachedTrace = getAttachedStackTrace(error); |
- if (attachedTrace != null) { |
+ if (stackTrace == null && error is Error) { |
// Overwrite the explicit stack trace, because it probably came from a |
// rethrow in the first place. |
- stackTrace = attachedTrace; |
+ stackTrace = error.stackTrace; |
} |
if (stackTrace == null) stackTrace = new Trace.current(); |