otherwise method

void otherwise(
  1. void buildError(
    1. MessageHandlerBuilder<M, D, AsyncError> builder
    ), {
  2. String? label,
})
inherited

Adds a message handling behavior that will take place when Result.isError is true.

The buildError callback is used to define the behavior that should take place.

Implementation

void otherwise(
  void Function(BError builder) buildError, {
  String? label,
}) {
  var errorBuilder = _makeErrorBuilder(_resultRef);
  buildError(errorBuilder);
  _failureDescrRef.value = errorBuilder.descriptor;
}