code: def is_error_retryable(request, exc):
      
      if is_last_attempt(request):
          return False
  
      return (
          isinstance(exc, RetryableException)
          or IRetryableError.providedBy(exc)
      )
docs: Return ``True`` if the exception is recognized as :term:`retryable error`.
  
      This will return ``False`` if the request is on its last attempt.
      This will return ``False`` if ``pyramid_retry`` is inactive for the
      request.