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(); |