Index: sdk/lib/async/zone.dart |
diff --git a/sdk/lib/async/zone.dart b/sdk/lib/async/zone.dart |
index 2306a6e646a72f38d4af7130ac73861ab4b9cc83..64289a5b0105f501582a7b85b0f5ae84a1c4a6be 100644 |
--- a/sdk/lib/async/zone.dart |
+++ b/sdk/lib/async/zone.dart |
@@ -701,16 +701,18 @@ class _CustomizedZone extends _BaseZone { |
void _rootHandleUncaughtError( |
Zone self, ZoneDelegate parent, Zone zone, error, StackTrace stackTrace) { |
- _scheduleAsyncCallback(() { |
- print("Uncaught Error: ${error}"); |
- var trace = stackTrace; |
- if (trace == null) trace = getAttachedStackTrace(error); |
- // Clear the attached stack trace (if any). |
- _attachStackTrace(error, null); |
- if (trace != null) { |
- print("Stack Trace: \n$trace\n"); |
- } |
- throw error; |
+ self.run(() { |
+ _scheduleAsyncCallback(() { |
+ print("Uncaught Error: ${error}"); |
+ var trace = stackTrace; |
+ if (trace == null) trace = getAttachedStackTrace(error); |
+ // Clear the attached stack trace (if any). |
+ _attachStackTrace(error, null); |
+ if (trace != null) { |
+ print("Stack Trace: \n$trace\n"); |
+ } |
+ throw error; |
+ }); |
}); |
} |