| 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 // Exceptions are thrown either by the VM or from Dart code. | 5 // Exceptions are thrown either by the VM or from Dart code. |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Interface implemented by all core library exceptions. | 8 * Interface implemented by all core library exceptions. |
| 9 * Defaults to an implementation that only carries a simple message. | 9 * Defaults to an implementation that only carries a simple message. |
| 10 */ | 10 */ |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * Exception thrown because of attempt to modify an immutable object. | 38 * Exception thrown because of attempt to modify an immutable object. |
| 39 */ | 39 */ |
| 40 class IllegalAccessException implements Exception { | 40 class IllegalAccessException implements Exception { |
| 41 const IllegalAccessException(); | 41 const IllegalAccessException(); |
| 42 String toString() => "Attempt to modify an immutable object"; | 42 String toString() => "Attempt to modify an immutable object"; |
| 43 } | 43 } |
| 44 | 44 |
| 45 | |
| 46 class ClosureArgumentMismatchException implements Exception { | |
| 47 const ClosureArgumentMismatchException(); | |
| 48 String toString() => "Closure argument mismatch"; | |
| 49 } | |
| 50 | |
| 51 | |
| 52 class ObjectNotClosureException implements Exception { | |
| 53 const ObjectNotClosureException(); | |
| 54 String toString() => "Object is not closure"; | |
| 55 } | |
| 56 | |
| 57 | |
| 58 /** | 45 /** |
| 59 * Exception thrown when a string or some other data does not have an expected | 46 * Exception thrown when a string or some other data does not have an expected |
| 60 * format and cannot be parsed or processed. | 47 * format and cannot be parsed or processed. |
| 61 */ | 48 */ |
| 62 class FormatException implements Exception { | 49 class FormatException implements Exception { |
| 63 /** | 50 /** |
| 64 * A message describing the format error. | 51 * A message describing the format error. |
| 65 */ | 52 */ |
| 66 final String message; | 53 final String message; |
| 67 | 54 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 122 } |
| 136 | 123 |
| 137 /** | 124 /** |
| 138 * Exception thrown when a runtime error occurs. | 125 * Exception thrown when a runtime error occurs. |
| 139 */ | 126 */ |
| 140 class RuntimeError implements Exception { | 127 class RuntimeError implements Exception { |
| 141 final message; | 128 final message; |
| 142 RuntimeError(this.message); | 129 RuntimeError(this.message); |
| 143 String toString() => "RuntimeError: $message"; | 130 String toString() => "RuntimeError: $message"; |
| 144 } | 131 } |
| OLD | NEW |