
    };e                     N   d Z eZg dZ G d de      Z G d de      Z G d de      Z G d d	e      Z G d
 de      Z	 G d de      Z
 G d de
      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de
      Zd Zy) zlazr.restfulclient errors.)
BadRequestConflictClientErrorCredentialsErrorCredentialsFileError	HTTPErrorMethodNotAllowedNotFoundPreconditionFailedRestfulErrorResponseErrorServerErrorUnauthorizedUnexpectedResponseErrorc                       e Zd ZdZy)r   z2Base error for the lazr.restfulclient API library.N__name__
__module____qualname____doc__     ;/usr/lib/python3/dist-packages/lazr/restfulclient/errors.pyr   r   (   s    <r   r   c                       e Zd ZdZy)r   z&Base credentials/authentication error.Nr   r   r   r   r   r   ,   s    0r   r   c                       e Zd ZdZy)r   zError in credentials file.Nr   r   r   r   r   r   0   s    $r   r   c                       e Zd ZdZd Zy)r   zError in response.c                 J    t         j                  |        || _        || _        y )N)r   __init__responsecontent)selfr   r   s      r   r   zResponseError.__init__7   s    d# r   N)r   r   r   r   r   r   r   r   r   r   4   s
    r   r   c                       e Zd ZdZd Zy)r   z$An unexpected response was received.c                 `    | j                   j                  d| j                   j                  S )N: )r   statusreason)r    s    r   __str__zUnexpectedResponseError.__str__@   s!    ==//1E1EFFr   Nr   r   r   r   r&   r   r   r   r   r   =   s    .Gr   r   c                       e Zd ZdZd Zy)r   z+An HTTP non-2xx response code was received.c           	         dj                  t        | j                  j                               D cg c]  }d|z  	 c}      }d| j                  j                  d| j                  j
                  d|d| j                  d	S c c}w )z9Show the error code, response headers, and response body.
z%s: %szHTTP Error r#   z
Response headers:
---
z
---
Response body:
---
z
---
)joinsortedr   itemsr$   r%   r   )r    pairheaderss      r   r&   zHTTPError.__str__G   si    )))/0C0C0E)FGX_G
 ]]!!4==#7#7$,,	P 	P Hs   BNr'   r   r   r   r   r   D   s    5	Pr   r   c                       e Zd ZdZy)r   z.An exception representing a client-side error.Nr   r   r   r   r   r   S       8r   r   c                       e Zd ZdZy)r   z4An exception representing an authentication failure.Nr   r   r   r   r   r   W   s    >r   r   c                       e Zd ZdZy)r	   z1An exception representing a nonexistent resource.Nr   r   r   r   r	   r	   [   s    ;r   r	   c                       e Zd ZdZy)r   zAn exception raised when you use an unsupported HTTP method.

    This is most likely because you tried to delete a resource that
    can't be deleted.
    Nr   r   r   r   r   r   _   s    r   r   c                       e Zd ZdZy)r   z:An exception representing a problem with a client request.Nr   r   r   r   r   r   g   s    Dr   r   c                       e Zd ZdZy)r   z9An exception representing a conflict with another client.Nr   r   r   r   r   r   k   s    Cr   r   c                       e Zd ZdZy)r
   zAn exception representing the failure of a conditional PUT/PATCH.

    The most likely explanation is that another client changed this
    object while you were working on it, and your version of the
    object is now out of date.
    Nr   r   r   r   r
   r
   o   s    r   r
   c                       e Zd ZdZy)r   z.An exception representing a server-side error.Nr   r   r   r   r   r   x   r1   r   r   c                 .   t         t        t        t        t        t
        d}| j                  dz  dk  ry|j                  | j                  t              }|t        u r1| j                  dz  dk(  rt        }n| j                  dz  dk(  rt        } || |      S )zTurn an HTTP response into an HTTPError subclass.

    :return: None if the response code is 1xx, 2xx or 3xx. Otherwise,
    an instance of an appropriate HTTPError subclass (or HTTPError
    if nothing else is appropriate.
    )i  i  i  i  i  i  d      N      )r   r   r	   r   r   r
   r$   getr   r   r   )r   r   http_errors_by_status_codeclss       r   	error_forrA   |   s     " #"(,,X__iH
i??c!Q&C__#q(Cx!!r   N)r   type__metaclass____all__	Exceptionr   r   r   r   r   r   r   r   r	   r   r   r   r
   r   rA   r   r   r   <module>rF      s   & !$=9 =1| 1%+ %L Gm GP P9) 9?; ?<{ <{ E ED{ D 9) 9"r   