OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.async; | 5 part of dart.async; |
6 | 6 |
7 /** | 7 /** |
8 * Error result of an asynchronous computation. | 8 * Error result of an asynchronous computation. |
9 */ | 9 */ |
10 class AsyncError { | 10 class AsyncError { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 throwDelayed() { | 53 throwDelayed() { |
54 reportError() { | 54 reportError() { |
55 print("Uncaught Error: $error"); | 55 print("Uncaught Error: $error"); |
56 if (stackTrace != null) { | 56 if (stackTrace != null) { |
57 print("Stack Trace:\n$stackTrace\n"); | 57 print("Stack Trace:\n$stackTrace\n"); |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 try { | 61 try { |
62 new Timer(0, (_) { | 62 Timer.run(() { |
63 reportError(); | 63 reportError(); |
64 // TODO(floitsch): we potentially want to call the global error handler | 64 // TODO(floitsch): we potentially want to call the global error handler |
65 // directly so that we can pass the stack trace. | 65 // directly so that we can pass the stack trace. |
66 throw error; | 66 throw error; |
67 }); | 67 }); |
68 } catch (e) { | 68 } catch (e) { |
69 // Unfortunately there is not much more we can do... | 69 // Unfortunately there is not much more we can do... |
70 reportError(); | 70 reportError(); |
71 } | 71 } |
72 } | 72 } |
73 } | 73 } |
74 | 74 |
OLD | NEW |