| 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. | |
| 10 */ | 9 */ |
| 11 interface Exception default ExceptionImplementation { | 10 interface Exception default ExceptionImplementation { |
| 12 const Exception([var message]); | 11 const Exception([var msg]); |
| 13 } | 12 } |
| 14 | 13 |
| 15 | 14 |
| 16 /** | 15 /** |
| 17 * Exception thrown because of an index outside of the valid range. | 16 * Exception thrown because of an index outside of the valid range. |
| 18 */ | 17 */ |
| 19 class IndexOutOfRangeException implements Exception { | 18 class IndexOutOfRangeException implements Exception { |
| 20 const IndexOutOfRangeException(this._value); | 19 const IndexOutOfRangeException(this._value); |
| 21 | 20 |
| 22 String toString() => "IndexOutOfRangeException: $_value"; | 21 String toString() => "IndexOutOfRangeException: $_value"; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } | 150 } |
| 152 | 151 |
| 153 /** | 152 /** |
| 154 * Exception thrown when a runtime error occurs. | 153 * Exception thrown when a runtime error occurs. |
| 155 */ | 154 */ |
| 156 class RuntimeError implements Exception { | 155 class RuntimeError implements Exception { |
| 157 final message; | 156 final message; |
| 158 RuntimeError(this.message); | 157 RuntimeError(this.message); |
| 159 String toString() => "RuntimeError: $message"; | 158 String toString() => "RuntimeError: $message"; |
| 160 } | 159 } |
| OLD | NEW |