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_core; | |
6 | |
7 // Exceptions are thrown either by the VM or from Dart code. | 5 // Exceptions are thrown either by the VM or from Dart code. |
8 | 6 |
9 /** | 7 /** |
10 * A marker interface implemented by all core library exceptions. | 8 * A marker interface implemented by all core library exceptions. |
11 * | 9 * |
12 * An [Exception] is intended to convey information to the user about a failure, | 10 * An [Exception] is intended to convey information to the user about a failure, |
13 * so that the error can be addressed programmatically. It is intended to be | 11 * so that the error can be addressed programmatically. It is intended to be |
14 * caught, and it should contain useful data fields. | 12 * caught, and it should contain useful data fields. |
15 * | 13 * |
16 * Creating instances of [Exception] directly with [:new Exception("message"):] | 14 * Creating instances of [Exception] directly with [:new Exception("message"):] |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } | 66 } |
69 | 67 |
70 /** | 68 /** |
71 * Exception thrown when a runtime error occurs. | 69 * Exception thrown when a runtime error occurs. |
72 */ | 70 */ |
73 class RuntimeError implements Exception { | 71 class RuntimeError implements Exception { |
74 final message; | 72 final message; |
75 RuntimeError(this.message); | 73 RuntimeError(this.message); |
76 String toString() => "RuntimeError: $message"; | 74 String toString() => "RuntimeError: $message"; |
77 } | 75 } |
OLD | NEW |