If no retryIf function is given this will retry any for any Exception thrown. To retry on an Error, the error must be caught and rethrown as an Exception.
FutureOr<bool> Function(Exception)? retryIf;