reportCrash method

void reportCrash(
  1. Exception exception,
  2. Severity severity, {
  3. StackTrace? stack,
  4. Map<String, dynamic> customProperties = const {},
})

Implementation

void reportCrash(Exception exception, Severity severity, {StackTrace? stack, Map<String, dynamic> customProperties = const {} }) async
{
  print("Reporting Crash");
  String stacktrace = stack == null ? StackTrace.current.toString() : stack
      .toString();

  HashMap<String, String?> requestData = await returnPostData(exception, stacktrace, severity, CrashType.HANDLED, customProperties);

  if (_initialisationCompleted) {
    print("Initialisation completed, sending request");
    _sendRequest("crash", requestData);
  }
  else
  {
    print("Initialisation not completed added to queue");
    CrashCatch._crashQueue.add(requestData);
  }
}