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

Side by Side Diff: lib/core/errors.dart

Issue 11269045: Convert NoMoreElementsException and EmptyQueueException to StateError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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
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 class Error { 5 class Error {
6 const Error(); 6 const Error();
7 } 7 }
8 8
9 /** 9 /**
10 * Error thrown by the runtime system when an assert statement fails. 10 * Error thrown by the runtime system when an assert statement fails.
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 /** 150 /**
151 * The operation was not allowed by the object. 151 * The operation was not allowed by the object.
152 * 152 *
153 * This [Error] is thrown when a class cannot implement 153 * This [Error] is thrown when a class cannot implement
154 * one of the methods in its signature. 154 * one of the methods in its signature.
155 */ 155 */
156 class UnsupportedError implements Error { 156 class UnsupportedError implements Error {
157 final String message; 157 final String message;
158 UnsupportedError(this.message); 158 UnsupportedError(this.message);
159 String toString() => message; 159 String toString() => "Unsupported operation: message";
160 } 160 }
161 161
162 /** 162 /**
163 * The operation was not allowed by the current state of the object. 163 * The operation was not allowed by the current state of the object.
164 * 164 *
165 * This is a generic error used for a variety of different erroneous 165 * This is a generic error used for a variety of different erroneous
166 * actions. The message should be descriptive. 166 * actions. The message should be descriptive.
167 */ 167 */
168 class StateError implements Error { 168 class StateError implements Error {
169 final String message; 169 final String message;
170 StateError(this.message); 170 StateError(this.message);
171 String toString() => message; 171 String toString() => "Bad state: message";
172 } 172 }
173 173
174 174
175 class OutOfMemoryError implements Error { 175 class OutOfMemoryError implements Error {
176 const OutOfMemoryError(); 176 const OutOfMemoryError();
177 String toString() => "Out of Memory"; 177 String toString() => "Out of Memory";
178 } 178 }
179 179
180 class StackOverflowError implements Error { 180 class StackOverflowError implements Error {
181 const StackOverflowError(); 181 const StackOverflowError();
182 String toString() => "Stack Overflow"; 182 String toString() => "Stack Overflow";
183 } 183 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/types/concrete_types_inferrer.dart ('k') | lib/core/exceptions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698