| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 class UnsupportedOperationException implements Exception { | 108 class UnsupportedOperationException implements Exception { |
| 109 const UnsupportedOperationException(String this._message); | 109 const UnsupportedOperationException(String this._message); |
| 110 String toString() => "UnsupportedOperationException: $_message"; | 110 String toString() => "UnsupportedOperationException: $_message"; |
| 111 final String _message; | 111 final String _message; |
| 112 } | 112 } |
| 113 | 113 |
| 114 | 114 |
| 115 class NotImplementedException implements Exception { | 115 class NotImplementedException implements Exception { |
| 116 const NotImplementedException([String message]) : this._message = message; | 116 const NotImplementedException([String message]) : this._message = message; |
| 117 String toString() => (this._message !== null | 117 String toString() => (this._message != null |
| 118 ? "NotImplementedException: $_message" | 118 ? "NotImplementedException: $_message" |
| 119 : "NotImplementedException"); | 119 : "NotImplementedException"); |
| 120 final String _message; | 120 final String _message; |
| 121 } | 121 } |
| 122 | 122 |
| 123 | 123 |
| 124 class IllegalJSRegExpException implements Exception { | 124 class IllegalJSRegExpException implements Exception { |
| 125 const IllegalJSRegExpException(String this._pattern, String this._errmsg); | 125 const IllegalJSRegExpException(String this._pattern, String this._errmsg); |
| 126 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; | 126 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; |
| 127 final String _pattern; | 127 final String _pattern; |
| 128 final String _errmsg; | 128 final String _errmsg; |
| 129 } | 129 } |
| 130 | 130 |
| 131 | 131 |
| 132 class IntegerDivisionByZeroException implements Exception { | 132 class IntegerDivisionByZeroException implements Exception { |
| 133 const IntegerDivisionByZeroException(); | 133 const IntegerDivisionByZeroException(); |
| 134 String toString() => "IntegerDivisionByZeroException"; | 134 String toString() => "IntegerDivisionByZeroException"; |
| 135 } | 135 } |
| 136 | 136 |
| 137 /** | 137 /** |
| 138 * Exception thrown when a runtime error occurs. | 138 * Exception thrown when a runtime error occurs. |
| 139 */ | 139 */ |
| 140 class RuntimeError implements Exception { | 140 class RuntimeError implements Exception { |
| 141 final message; | 141 final message; |
| 142 RuntimeError(this.message); | 142 RuntimeError(this.message); |
| 143 String toString() => "RuntimeError: $message"; | 143 String toString() => "RuntimeError: $message"; |
| 144 } | 144 } |
| OLD | NEW |