isTransientError function

bool isTransientError(
  1. Object error
)

Classifies whether an error is transient and worth retrying.

Implementation

bool isTransientError(Object error) {
  if (error is SocketException) return true;
  if (error is HttpException) return true;
  if (error is TimeoutException) return true;
  if (error is HttpDownloadException) return error.isTransient;
  return false;
}