handle method

void handle(
  1. Object exception, [
  2. StackTrace? stackTrace,
  3. dynamic msg
])

Handle common exceptions in your code Object exception - exception StackTrace? stackTrace - stackTrace String? msg - message describes what happened

try {
  // your code...
} catch (e, st) {
  talker.handle(e, st, 'Exception in ...');
}

Implementation

void handle(
  Object exception, [
  StackTrace? stackTrace,
  dynamic msg,
]) {
  final data = _errorHandler.handle(exception, stackTrace, msg?.toString());
  if (data is TalkerError) {
    _handleErrorData(data);
    return;
  }
  if (data is TalkerException) {
    _handleErrorData(data);
    return;
  }
  if (data is TalkerLog) {
    _handleLogData(data);
  }
}