catchErrorOnly method

Future<T> catchErrorOnly(
  1. void onError(
    1. Object? error
    ), {
  2. bool test(
    1. Object error
    )?,
})

Handles errors emitted by this Future.

Semantically, this is identical to calling catchError.

... except that the type signature of onError is strengthened. For historic reasons, the original type signature accepts functions that will always throw at runtime or have unexpected behavior.

Implementation

Future<T> catchErrorOnly(
  void Function(Object? error) onError, {
  bool Function(Object error)? test,
}) {
  return catchError(onError, test: test);
}