Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: corelib/src/exceptions.dart

Issue 10850034: Rename BadNumberFormatException -> FormatException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Re-word comment as TODO. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | corelib/src/math.dart » ('j') | utils/tests/pub/pub.status » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 String toString() => "Out of Memory"; 103 String toString() => "Out of Memory";
104 } 104 }
105 105
106 106
107 class StackOverflowException implements Exception { 107 class StackOverflowException implements Exception {
108 const StackOverflowException(); 108 const StackOverflowException();
109 String toString() => "Stack Overflow"; 109 String toString() => "Stack Overflow";
110 } 110 }
111 111
112 112
113 class BadNumberFormatException implements Exception { 113 /**
114 const BadNumberFormatException(String this._s); 114 * Exception thrown when a string or some other data does not have an expected
115 String toString() => "BadNumberFormatException: '$_s'"; 115 * format and cannot be parsed or processed.
116 final String _s; 116 */
117 class FormatException implements Exception {
118 /**
119 * A message describing the format error.
120 */
121 final String message;
Ivan Posva 2012/08/03 20:36:27 Is it intentional that you are making the message
122
123 /**
124 * Creates a new FormatException with an optional error [message].
125 */
126 const FormatException([this.message = ""]);
127
128 String toString() => "FormatException: $message";
117 } 129 }
118 130
119 131
120 class WrongArgumentCountException implements Exception { 132 class WrongArgumentCountException implements Exception {
121 const WrongArgumentCountException(); 133 const WrongArgumentCountException();
122 String toString() => "WrongArgumentCountException"; 134 String toString() => "WrongArgumentCountException";
123 } 135 }
124 136
125 137
126 class NullPointerException implements Exception { 138 class NullPointerException implements Exception {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; 187 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'";
176 final String _pattern; 188 final String _pattern;
177 final String _errmsg; 189 final String _errmsg;
178 } 190 }
179 191
180 192
181 class IntegerDivisionByZeroException implements Exception { 193 class IntegerDivisionByZeroException implements Exception {
182 const IntegerDivisionByZeroException(); 194 const IntegerDivisionByZeroException();
183 String toString() => "IntegerDivisionByZeroException"; 195 String toString() => "IntegerDivisionByZeroException";
184 } 196 }
OLDNEW
« no previous file with comments | « no previous file | corelib/src/math.dart » ('j') | utils/tests/pub/pub.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698