NamedException class Null safety

Wrapper around the built-in Exception class.

Provides more classified details of the exception like severity.

Example:

final exception = NamedException.create('Provided value is -26 which is negative.');

or

final exception = NamedException.create(
  'Provided value is -26 which is negative.'
  solution: 'Please provide a positive value.'
  severity: ExceptionSeverity.critical,
);
Implemented types
Implementers

Constructors

NamedException()
Empty default constructor for sub classes.
const
NamedException.create(String problem, {String name = 'UnnamedException', String solution = '<none>', ExceptionSeverity severity = ExceptionSeverity.none})
Example: [...]
factory
NamedException.empty()
Example: [...]
factory

Properties

category Type
category is either the super class or this class.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
key String
An identifer for the exception. Default to the class's runtimeType.
read-only, override
name String
A more user readable exception name than the key. Default to key unless otherwise specified.
read-only
problem String
Problem statement of the Exception. [...]
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
severity ExceptionSeverity
Severity can be none, warning or critical.
read-only
solution String
Solution statement of the Exception. [...]
read-only
text String
Complete description of the Exception. [...]
read-only

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
toString function returns the exception's text
override

Operators

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