OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library pub.asset.serialize.exception; | |
6 | |
7 import 'package:barback/barback.dart'; | 5 import 'package:barback/barback.dart'; |
8 import 'package:stack_trace/stack_trace.dart'; | 6 import 'package:stack_trace/stack_trace.dart'; |
9 | 7 |
10 import '../utils.dart'; | 8 import '../utils.dart'; |
11 | 9 |
12 /// An exception that was originally raised in another isolate. | 10 /// An exception that was originally raised in another isolate. |
13 /// | 11 /// |
14 /// Exception objects can't cross isolate boundaries in general, so this class | 12 /// Exception objects can't cross isolate boundaries in general, so this class |
15 /// wraps as much information as can be consistently serialized. | 13 /// wraps as much information as can be consistently serialized. |
16 class CrossIsolateException implements Exception { | 14 class CrossIsolateException implements Exception { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 /// | 91 /// |
94 /// This handles [AssetNotFoundException]s specially, ensuring that their | 92 /// This handles [AssetNotFoundException]s specially, ensuring that their |
95 /// metadata is preserved. | 93 /// metadata is preserved. |
96 CrossIsolateException deserializeException(Map error) { | 94 CrossIsolateException deserializeException(Map error) { |
97 if (error['type'] == 'AssetNotFoundException') { | 95 if (error['type'] == 'AssetNotFoundException') { |
98 return new _CrossIsolateAssetNotFoundException.deserialize(error); | 96 return new _CrossIsolateAssetNotFoundException.deserialize(error); |
99 } else { | 97 } else { |
100 return new CrossIsolateException.deserialize(error); | 98 return new CrossIsolateException.deserialize(error); |
101 } | 99 } |
102 } | 100 } |
OLD | NEW |