ErrorOfType<T extends ErrorType> class

Parameterized error template.

The generic type T indicates what type of error occured. Usage:

// Creating a new [ErrorType].
class SerializationFailed extends ErrorType{}

// Throwing an error of type [ErrorType].
throw ErrorOfType<SerializationFailed>;
Inheritance

Constructors

ErrorOfType({Object message = '', Object invalidState = '', Object expectedState = ''})

Properties

expectedState Object
Object conveying information about an expected state.
final
hashCode int
The hash code for this object.
no setterinherited
invalidState Object
Object conveying information about the invalid state.
final
message Object
Optional message added when the error is thrown.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTrace StackTrace?
The stack trace at the point where this error was first thrown.
no setterinherited
typeArgument Type
Type argument of the error class.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

colorOutput ColorOutput
Set to ColorOutput.ON to enable color output to terminal.
getter/setter pair