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

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: ADded test expectations. 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
« no previous file with comments | « lib/core/bool.dart ('k') | lib/core/exceptions.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/core/errors.dart
diff --git a/lib/core/errors.dart b/lib/core/errors.dart
index 20a277eb83f05ee6cb7a646effe2c710ac774149..eca6fea8f426adfa811e263be69e811da3b20fac 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. */
@@ -137,6 +147,31 @@ class NoSuchMethodError implements Error {
}
+/**
+ * The operation was not allowed by the object.
+ *
+ * This [Error] is thrown when a class cannot implement
+ * one of the methods in its signature.
+ */
+class UnsupportedError implements Error {
+ final String message;
+ UnsupportedError(this.message);
+ String toString() => message;
+}
+
+/**
+ * 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 implements Error {
+ final String message;
+ StateError(this.message);
+ String toString() => message;
+}
+
+
class OutOfMemoryError implements Error {
const OutOfMemoryError();
String toString() => "Out of Memory";
« no previous file with comments | « lib/core/bool.dart ('k') | lib/core/exceptions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698