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

Side by Side Diff: pkg/testing/lib/src/error_handling.dart

Issue 2743423009: Run dartfmt on remaining unformated pkg packages (Closed)
Patch Set: Run dartfmt on remaining unformated pkg packages Created 3 years, 9 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 | « pkg/testing/lib/src/discover.dart ('k') | pkg/testing/lib/src/expectation.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 library testing.error_handling; 5 library testing.error_handling;
6 6
7 import 'dart:async' show 7 import 'dart:async' show Future;
8 Future;
9 8
10 import 'dart:io' show 9 import 'dart:io' show exitCode, stderr;
11 exitCode,
12 stderr;
13 10
14 import 'dart:isolate' show 11 import 'dart:isolate' show ReceivePort;
15 ReceivePort;
16 12
17 Future withErrorHandling(Future f()) async { 13 Future withErrorHandling(Future f()) async {
18 final ReceivePort port = new ReceivePort(); 14 final ReceivePort port = new ReceivePort();
19 try { 15 try {
20 return await f(); 16 return await f();
21 } catch (e, trace) { 17 } catch (e, trace) {
22 exitCode = 1; 18 exitCode = 1;
23 stderr.writeln(e); 19 stderr.writeln(e);
24 if (trace != null) { 20 if (trace != null) {
25 stderr.writeln(trace); 21 stderr.writeln(trace);
26 } 22 }
27 } finally { 23 } finally {
28 port.close(); 24 port.close();
29 } 25 }
30 } 26 }
OLDNEW
« no previous file with comments | « pkg/testing/lib/src/discover.dart ('k') | pkg/testing/lib/src/expectation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698