| 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 28 matching lines...) Expand all Loading... |
| 39 String toString() => "Closure argument mismatch"; | 39 String toString() => "Closure argument mismatch"; |
| 40 } | 40 } |
| 41 | 41 |
| 42 | 42 |
| 43 class ObjectNotClosureException implements Exception { | 43 class ObjectNotClosureException implements Exception { |
| 44 const ObjectNotClosureException(); | 44 const ObjectNotClosureException(); |
| 45 String toString() => "Object is not closure"; | 45 String toString() => "Object is not closure"; |
| 46 } | 46 } |
| 47 | 47 |
| 48 | 48 |
| 49 class IllegalArgumentException implements Exception { | |
| 50 const IllegalArgumentException([arg = ""]) : _arg = arg; | |
| 51 String toString() => "Illegal argument(s): $_arg"; | |
| 52 final _arg; | |
| 53 } | |
| 54 | |
| 55 | |
| 56 class OutOfMemoryException implements Exception { | 49 class OutOfMemoryException implements Exception { |
| 57 const OutOfMemoryException(); | 50 const OutOfMemoryException(); |
| 58 String toString() => "Out of Memory"; | 51 String toString() => "Out of Memory"; |
| 59 } | 52 } |
| 60 | 53 |
| 61 | 54 |
| 62 class StackOverflowException implements Exception { | 55 class StackOverflowException implements Exception { |
| 63 const StackOverflowException(); | 56 const StackOverflowException(); |
| 64 String toString() => "Stack Overflow"; | 57 String toString() => "Stack Overflow"; |
| 65 } | 58 } |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } | 144 } |
| 152 | 145 |
| 153 /** | 146 /** |
| 154 * Exception thrown when a runtime error occurs. | 147 * Exception thrown when a runtime error occurs. |
| 155 */ | 148 */ |
| 156 class RuntimeError implements Exception { | 149 class RuntimeError implements Exception { |
| 157 final message; | 150 final message; |
| 158 RuntimeError(this.message); | 151 RuntimeError(this.message); |
| 159 String toString() => "RuntimeError: $message"; | 152 String toString() => "RuntimeError: $message"; |
| 160 } | 153 } |
| OLD | NEW |