| 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";
|
|
|