handleError method

  1. @protected
  2. @mustCallSuper
void handleError(
  1. Exception exception, {
  2. String? tag,
})

Handle exception which is thrown from mapping event-state process.

Implementation

@protected
@mustCallSuper
void handleError(Exception exception, {String? tag}) {
  if (exception is KntException) {
    if (needLog) {
      logger.e('❌❌ KntException: $exception ❌❌');
    }
    add(
      BaseErrorEvent(
        exception: exception,
        tag: tag,
      ),
    );
    return;
  }
  if (needLog) {
    logger.e('❌❌ Error: $exception ❌❌');
  }
  add(
    BaseErrorEvent(
      exception: convertedException(exception),
      tag: tag,
    ),
  );
}