exception method

Future<void> exception(
  1. dynamic exception, {
  2. String? caller,
})

Implementation

Future<void> exception(dynamic exception, {String? caller}) async
{
  try
  {
    // show dialog in debug mode only
    // if (kDebugMode) DialogService().show(type: DialogType.error, title: phrase.error, description: 'Exception: $exception Routine: $caller');

    // print in debug mode only
    if (kDebugMode) print('Exception: $exception' + (caller != null ? ' -> $caller' : ''));

    // add the entry
    DATABASE.Log e = DATABASE.Log(type: "exception", message: '$exception', caller: caller);
    _addEntry(e);
  }
  catch(ex)
  {
    print('Catch - Exception: $exception' + (caller != null ? ' -> $caller' : ''));
  }
}