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 */ | 9 */ |
10 interface Exception default ExceptionImplementation { | 10 interface Exception default ExceptionImplementation { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 | 153 |
154 class UnsupportedOperationException implements Exception { | 154 class UnsupportedOperationException implements Exception { |
155 const UnsupportedOperationException(String this._message); | 155 const UnsupportedOperationException(String this._message); |
156 String toString() => "UnsupportedOperationException: $_message"; | 156 String toString() => "UnsupportedOperationException: $_message"; |
157 final String _message; | 157 final String _message; |
158 } | 158 } |
159 | 159 |
160 | 160 |
161 class NotImplementedException implements Exception { | 161 class NotImplementedException implements Exception { |
162 const NotImplementedException(); | 162 const NotImplementedException([String this._message]); |
163 String toString() => "NotImplementedException"; | 163 String toString() => (this._message !== null |
| 164 ? "NotImplementedException: $_message" |
| 165 : "NotImplementedException"); |
| 166 final String _message; |
164 } | 167 } |
165 | 168 |
166 | 169 |
167 class IllegalJSRegExpException implements Exception { | 170 class IllegalJSRegExpException implements Exception { |
168 const IllegalJSRegExpException(String this._pattern, String this._errmsg); | 171 const IllegalJSRegExpException(String this._pattern, String this._errmsg); |
169 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; | 172 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; |
170 final String _pattern; | 173 final String _pattern; |
171 final String _errmsg; | 174 final String _errmsg; |
172 } | 175 } |
173 | 176 |
174 | 177 |
175 class IntegerDivisionByZeroException implements Exception { | 178 class IntegerDivisionByZeroException implements Exception { |
176 const IntegerDivisionByZeroException(); | 179 const IntegerDivisionByZeroException(); |
177 String toString() => "IntegerDivisionByZeroException"; | 180 String toString() => "IntegerDivisionByZeroException"; |
178 } | 181 } |
OLD | NEW |