BasicException constructor

const BasicException(
  1. String problem, {
  2. String name = 'UnnamedException',
  3. String solution = '<none>',
  4. ExceptionSeverity severity = ExceptionSeverity.none,
})

Example:

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

or

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

Implementation

const BasicException(
  this.problem, {
  String name = 'UnnamedException',
  this.solution = '<none>',
  this.severity = ExceptionSeverity.none,
}) : key = name;