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

Side by Side Diff: lib/src/runner/vm/catch_isolate_errors.dart

Issue 1685363002: Add a platform plugin infrastructure. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « lib/src/runner/runner_test.dart ('k') | lib/src/runner/vm/environment.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:isolate';
6 import 'dart:async';
7
8 import 'package:stack_trace/stack_trace.dart';
9
10 /// Capture any top-level errors (mostly lazy syntax errors, since other are
11 /// caught below) and report them to the parent isolate.
12 void catchIsolateErrors() {
13 var errorPort = new ReceivePort();
14 // Aet errors non-fatal because otherwise they'll be double-printed.
15 Isolate.current.setErrorsFatal(false);
16 Isolate.current.addErrorListener(errorPort.sendPort);
17 errorPort.listen((message) {
18 // Masquerade as an IsoalteSpawnException because that's what this would
19 // be if the error had been detected statically.
20 var error = new IsolateSpawnException(message[0]);
21 var stackTrace =
22 message[1] == null ? new Trace([]) : new Trace.parse(message[1]);
23 Zone.current.handleUncaughtError(error, stackTrace);
24 });
25 }
OLDNEW
« no previous file with comments | « lib/src/runner/runner_test.dart ('k') | lib/src/runner/vm/environment.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698