ExceptionOfType<T extends ExceptionType> class

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

import 'package:exception_templates/exception_templates.dart';

// Defining an exception type.
class DatabaseNotInitialized extends ExceptionType{}

// Throwing an exception of the newly defined type.
throw ExceptionOfType<DatabaseNotInitialized>;
Implemented types

Constructors

ExceptionOfType({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
Message added when the error is thrown.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
typeArgument Type
Type argument of the exception 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
Whether to enable color output.
getter/setter pair