checkForCancellation method

void checkForCancellation({
  1. BaseResponse? response,
})
inherited

Check if this request has been canceled.

Implementation

void checkForCancellation({BaseResponse? response}) {
  if (isCanceled) {
    final error = RequestException(method, uri, this, response,
        _cancellationError ?? Exception('Request canceled'));
    autoRetry.failures.add(error);
    throw error;
  }
}