| 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 16 matching lines...) Expand all Loading... |
| 27 * Exception thrown because of an index outside of the valid range. | 27 * Exception thrown because of an index outside of the valid range. |
| 28 */ | 28 */ |
| 29 class IndexOutOfRangeException implements Exception { | 29 class IndexOutOfRangeException implements Exception { |
| 30 const IndexOutOfRangeException(this._value); | 30 const IndexOutOfRangeException(this._value); |
| 31 | 31 |
| 32 String toString() => "IndexOutOfRangeException: $_value"; | 32 String toString() => "IndexOutOfRangeException: $_value"; |
| 33 | 33 |
| 34 final _value; | 34 final _value; |
| 35 } | 35 } |
| 36 | 36 |
| 37 /** | |
| 38 * Exception thrown because of attempt to modify an immutable object. | |
| 39 */ | |
| 40 class IllegalAccessException implements Exception { | |
| 41 const IllegalAccessException(); | |
| 42 String toString() => "Attempt to modify an immutable object"; | |
| 43 } | |
| 44 | |
| 45 | 37 |
| 46 class ClosureArgumentMismatchException implements Exception { | 38 class ClosureArgumentMismatchException implements Exception { |
| 47 const ClosureArgumentMismatchException(); | 39 const ClosureArgumentMismatchException(); |
| 48 String toString() => "Closure argument mismatch"; | 40 String toString() => "Closure argument mismatch"; |
| 49 } | 41 } |
| 50 | 42 |
| 51 | 43 |
| 52 class ObjectNotClosureException implements Exception { | 44 class ObjectNotClosureException implements Exception { |
| 53 const ObjectNotClosureException(); | 45 const ObjectNotClosureException(); |
| 54 String toString() => "Object is not closure"; | 46 String toString() => "Object is not closure"; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 String toString() => "NoMoreElementsException"; | 90 String toString() => "NoMoreElementsException"; |
| 99 } | 91 } |
| 100 | 92 |
| 101 | 93 |
| 102 class EmptyQueueException implements Exception { | 94 class EmptyQueueException implements Exception { |
| 103 const EmptyQueueException(); | 95 const EmptyQueueException(); |
| 104 String toString() => "EmptyQueueException"; | 96 String toString() => "EmptyQueueException"; |
| 105 } | 97 } |
| 106 | 98 |
| 107 | 99 |
| 108 class UnsupportedOperationException implements Exception { | |
| 109 const UnsupportedOperationException(String this._message); | |
| 110 String toString() => "UnsupportedOperationException: $_message"; | |
| 111 final String _message; | |
| 112 } | |
| 113 | |
| 114 | |
| 115 class NotImplementedException implements Exception { | 100 class NotImplementedException implements Exception { |
| 116 const NotImplementedException([String message]) : this._message = message; | 101 const NotImplementedException([String message]) : this._message = message; |
| 117 String toString() => (this._message !== null | 102 String toString() => (this._message !== null |
| 118 ? "NotImplementedException: $_message" | 103 ? "NotImplementedException: $_message" |
| 119 : "NotImplementedException"); | 104 : "NotImplementedException"); |
| 120 final String _message; | 105 final String _message; |
| 121 } | 106 } |
| 122 | 107 |
| 123 | 108 |
| 124 class IllegalJSRegExpException implements Exception { | 109 class IllegalJSRegExpException implements Exception { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 135 } | 120 } |
| 136 | 121 |
| 137 /** | 122 /** |
| 138 * Exception thrown when a runtime error occurs. | 123 * Exception thrown when a runtime error occurs. |
| 139 */ | 124 */ |
| 140 class RuntimeError implements Exception { | 125 class RuntimeError implements Exception { |
| 141 final message; | 126 final message; |
| 142 RuntimeError(this.message); | 127 RuntimeError(this.message); |
| 143 String toString() => "RuntimeError: $message"; | 128 String toString() => "RuntimeError: $message"; |
| 144 } | 129 } |
| OLD | NEW |