handleError method

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

Handle exception which is thrown from mapping event-state process

Implementation

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