handleError method
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(),
),
));
}
}