withRetry<T> method
Retry a request.
Implementation
Future<T> withRetry<T>(
Future<T> Function(void Function(Uri uri) logger) fn, {
required String gerund,
FutureOr<bool> Function(Exception)? retryIf,
FutureOr<void> Function(Exception)? onRetry,
}) {
final retry = _InternalRetry(
gerund: gerund,
emit: logger.emit,
fn: fn,
retryIf: retryIf,
onRetry: onRetry,
);
return _retryOptions.retry<T>(
retry,
retryIf: retry.retryIf,
onRetry: retry.onRetry,
);
}