(attempt_number, max_attempts, exception)
Prints an error message if appropriate.
Prints an error message if appropriate.
Prints an error message if appropriate .
def _print_retry_error(attempt_number, max_attempts, exception):
  """Prints an error message if appropriate."""
  now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')
  try:
    status_code = exception.resp.status
  except AttributeError:
    status_code = ''

  if attempt_number % 5 == 0:
    _print_error('{}: Caught exception {} {}'.format(
        now, get_exception_type_string(exception), status_code))
    _print_error('{}: This request is being retried (attempt {} of {}).'.format(
        now, attempt_number, max_attempts))
def _print_retry_error ( attempt_number , max_attempts , exception ) : now = datetime . datetime . now ( ) . strftime ( '%Y-%m-%d %H:%M:%S.%f' ) try : status_code = exception . resp . status except AttributeError : status_code = '' if attempt_number % 5 == 0 : _print_error ( '{}: Caught exception {} {}' . format ( now , get_exception_type_string ( exception ) , status_code ) ) _print_error ( '{}: This request is being retried (attempt {} of {}).' . format ( now , attempt_number , max_attempts ) )