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

Unified Diff: lib/core/errors.dart

Issue 11235054: Removed IllegalAccessException and UnsupportedOperationException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: lib/core/errors.dart
diff --git a/lib/core/errors.dart b/lib/core/errors.dart
index 20a277eb83f05ee6cb7a646effe2c710ac774149..a4d75e493f99dee4f850a5dce11891fee6dc0e21 100644
--- a/lib/core/errors.dart
+++ b/lib/core/errors.dart
@@ -6,18 +6,28 @@ class Error {
const Error();
}
+/**
+ * Error thrown by the runtime system when an assert statement fails.
+ */
class AssertionError implements Error {
}
+/**
+ * Error thrown by the runtime system when a type assertion fails.
+ */
class TypeError implements AssertionError {
}
+/**
+ * Error thrown by the runtime system when a cast operation fails.
+ */
class CastError implements Error {
}
/**
* Error thrown when a function is passed an unacceptable argument.
- */class ArgumentError implements Error {
+ */
+ class ArgumentError implements Error {
final message;
/** The [message] describes the erroneous argument. */
@@ -136,6 +146,18 @@ class NoSuchMethodError implements Error {
external static String _objectToString(Object object);
}
+/**
+ * The operation was not allowed by the current state of the object.
+ *
+ * This is a generic error used for a variety of different erroneous
+ * actions. The message should be descriptive.
+ */
+class StateError {
+ final String message;
+ StateError(this.message);
+ String toString() => message;
+}
+
class OutOfMemoryError implements Error {
const OutOfMemoryError();

Powered by Google App Engine
This is Rietveld 408576698