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 class Error { | 5 class Error { |
6 const Error(); | 6 const Error(); |
7 } | 7 } |
8 | 8 |
9 /** | 9 /** |
10 * Error thrown by the runtime system when an assert statement fails. | 10 * Error thrown by the runtime system when an assert statement fails. |
11 */ | 11 */ |
12 class AssertionError implements Error { | 12 class AssertionError implements Error { |
13 } | 13 } |
14 | 14 |
15 /** | 15 /** |
16 * Error thrown by the runtime system when a type assertion fails. | 16 * Error thrown by the runtime system when a type assertion fails. |
17 */ | 17 */ |
18 class TypeError implements AssertionError { | 18 class TypeError implements AssertionError { |
19 } | 19 } |
20 | 20 |
21 /** | 21 /** |
22 * Error thrown by the runtime system when a cast operation fails. | 22 * Error thrown by the runtime system when a cast operation fails. |
23 */ | 23 */ |
24 class CastError implements Error { | 24 class CastError implements Error { |
25 } | 25 } |
26 | 26 |
27 /** | 27 /** |
| 28 * Error thrown when attempting to throw [:null:]. |
| 29 */ |
| 30 class NullThrownError implements Error { |
| 31 const NullThrownError(); |
| 32 String toString() => "Throw of null."; |
| 33 } |
| 34 |
| 35 /** |
28 * Error thrown when a function is passed an unacceptable argument. | 36 * Error thrown when a function is passed an unacceptable argument. |
29 */ | 37 */ |
30 class ArgumentError implements Error { | 38 class ArgumentError implements Error { |
31 final message; | 39 final message; |
32 | 40 |
33 /** The [message] describes the erroneous argument. */ | 41 /** The [message] describes the erroneous argument. */ |
34 const ArgumentError([this.message]); | 42 const ArgumentError([this.message]); |
35 | 43 |
36 String toString() { | 44 String toString() { |
37 if (message != null) { | 45 if (message != null) { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 232 |
225 class OutOfMemoryError implements Error { | 233 class OutOfMemoryError implements Error { |
226 const OutOfMemoryError(); | 234 const OutOfMemoryError(); |
227 String toString() => "Out of Memory"; | 235 String toString() => "Out of Memory"; |
228 } | 236 } |
229 | 237 |
230 class StackOverflowError implements Error { | 238 class StackOverflowError implements Error { |
231 const StackOverflowError(); | 239 const StackOverflowError(); |
232 String toString() => "Stack Overflow"; | 240 String toString() => "Stack Overflow"; |
233 } | 241 } |
OLD | NEW |