NamedException.create constructor
NamedException.create(
- String problem, {
- String name = 'UnnamedException',
- String solution = '<none>',
- ExceptionSeverity severity = ExceptionSeverity.none,
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,
);
Implementation
factory NamedException.create(
String problem, {
String name = 'UnnamedException',
String solution = '<none>',
ExceptionSeverity severity = ExceptionSeverity.none,
}) =>
BasicException(
problem,
name: name,
solution: solution,
severity: severity,
);