| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 class UnsupportedOperationException implements Exception { | 120 class UnsupportedOperationException implements Exception { |
| 121 const UnsupportedOperationException(String this._message); | 121 const UnsupportedOperationException(String this._message); |
| 122 String toString() => "UnsupportedOperationException: $_message"; | 122 String toString() => "UnsupportedOperationException: $_message"; |
| 123 final String _message; | 123 final String _message; |
| 124 } | 124 } |
| 125 | 125 |
| 126 | 126 |
| 127 class NotImplementedException implements Exception { | 127 class NotImplementedException implements Exception { |
| 128 const NotImplementedException([String message]) : this._message = message; | 128 const NotImplementedException([String message]) : this._message = message; |
| 129 String toString() => (this._message !== null | 129 String toString() => (this._message != null |
| 130 ? "NotImplementedException: $_message" | 130 ? "NotImplementedException: $_message" |
| 131 : "NotImplementedException"); | 131 : "NotImplementedException"); |
| 132 final String _message; | 132 final String _message; |
| 133 } | 133 } |
| 134 | 134 |
| 135 | 135 |
| 136 class IllegalJSRegExpException implements Exception { | 136 class IllegalJSRegExpException implements Exception { |
| 137 const IllegalJSRegExpException(String this._pattern, String this._errmsg); | 137 const IllegalJSRegExpException(String this._pattern, String this._errmsg); |
| 138 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; | 138 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; |
| 139 final String _pattern; | 139 final String _pattern; |
| 140 final String _errmsg; | 140 final String _errmsg; |
| 141 } | 141 } |
| 142 | 142 |
| 143 | 143 |
| 144 class IntegerDivisionByZeroException implements Exception { | 144 class IntegerDivisionByZeroException implements Exception { |
| 145 const IntegerDivisionByZeroException(); | 145 const IntegerDivisionByZeroException(); |
| 146 String toString() => "IntegerDivisionByZeroException"; | 146 String toString() => "IntegerDivisionByZeroException"; |
| 147 } | 147 } |
| 148 | 148 |
| 149 /** | 149 /** |
| 150 * Exception thrown when a runtime error occurs. | 150 * Exception thrown when a runtime error occurs. |
| 151 */ | 151 */ |
| 152 class RuntimeError implements Exception { | 152 class RuntimeError implements Exception { |
| 153 final message; | 153 final message; |
| 154 RuntimeError(this.message); | 154 RuntimeError(this.message); |
| 155 String toString() => "RuntimeError: $message"; | 155 String toString() => "RuntimeError: $message"; |
| 156 } | 156 } |
| OLD | NEW |