onError method

KResult<T> onError(
  1. void handler(
    1. String message, [
    2. StackTrace? st
    ])
)

Implementation

KResult<T> onError(void Function(String message, [StackTrace? st]) handler) {
  if (isError) handler(message, stackTrace);
  return this;
}