| Index: pkg/stack_trace/lib/src/stack_zone_specification.dart
|
| diff --git a/pkg/stack_trace/lib/src/stack_zone_specification.dart b/pkg/stack_trace/lib/src/stack_zone_specification.dart
|
| index 36e0717d2ce7d18eaea9d8aa3a3a6475fa55602f..9a4f7c05af10f18893f1d9f0b0acb8b55fd0318b 100644
|
| --- a/pkg/stack_trace/lib/src/stack_zone_specification.dart
|
| +++ b/pkg/stack_trace/lib/src/stack_zone_specification.dart
|
| @@ -145,10 +145,21 @@ class StackZoneSpecification {
|
| /// [_onError] or [parent]'s error handler.
|
| handleUncaughtError(Zone self, ZoneDelegate parent, Zone zone, error,
|
| StackTrace stackTrace) {
|
| + var stackChain = chainFor(stackTrace);
|
| if (_onError == null) {
|
| - return parent.handleUncaughtError(zone, error, chainFor(stackTrace));
|
| - } else {
|
| - _onError(error, chainFor(stackTrace));
|
| + return parent.handleUncaughtError(zone, error, stackChain);
|
| + }
|
| +
|
| + // TODO(nweiz): Currently this copies a lot of logic from [runZoned]. Just
|
| + // allow [runBinary] to throw instead once issue 18134 is fixed.
|
| + try {
|
| + return parent.runBinary(zone, _onError, error, stackChain);
|
| + } catch (newError, newStackTrace) {
|
| + if (identical(newError, error)) {
|
| + return parent.handleUncaughtError(zone, error, stackChain);
|
| + } else {
|
| + return parent.handleUncaughtError(zone, newError, newStackTrace);
|
| + }
|
| }
|
| }
|
|
|
|
|