flatMap<R> method
Failure<R>
flatMap<R>(
- R onSuccess(
- T value
- ExceptionHandler? exceptionHandler,
- String? errorGroup,
override
Maps a Result<T> to Result<R> using the provided function. If the original result is a failure, the same error is retained.
onSuccess
is the function that transforms the value if the result is a success.
exceptionHandler
is an optional handler for any exceptions thrown during the transformation.
errorGroup
is an optional group identifier for the error.
Implementation
@override
Failure<R> flatMap<R>(
R Function(T value) onSuccess, {
ExceptionHandler? exceptionHandler,
String? errorGroup,
}) =>
Failure(_error);