File: //lib/python3/dist-packages/lazr/restfulclient/__pycache__/errors.cpython-38.pyc
U
�3�O� � @ s d Z eZddddddddd d
ddd
dgZG dd
� d
e�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�Z G dd� de�Z
G dd� de
�ZG dd
� d
e�ZG dd� de�Z
G dd� de�ZG dd� de�ZG dd� de�ZG dd � d e�ZG dd� de
�Zdd� ZdS ) zlazr.restfulclient errors.�
BadRequest�Conflict�ClientError�CredentialsError�CredentialsFileError� HTTPError�MethodNotAllowed�NotFound�PreconditionFailed�RestfulError�
ResponseError�ServerError�Unauthorized�UnexpectedResponseErrorc @ s e Zd ZdZdS )r
z2Base error for the lazr.restfulclient API library.N��__name__�
__module__�__qualname__�__doc__� r r �;/usr/lib/python3/dist-packages/lazr/restfulclient/errors.pyr
( s c @ s e Zd ZdZdS )r z&Base credentials/authentication error.Nr r r r r r , s c @ s e Zd ZdZdS )r zError in credentials file.Nr r r r r r 0 s c @ s e Zd ZdZdd� ZdS )r zError in response.c C s t �| � || _|| _d S )N)r
�__init__�response�content)�selfr r r r r r 7 s
zResponseError.__init__N)r r r r r r r r r r 4 s c @ s e Zd ZdZdd� ZdS )r z$An unexpected response was received.c C s d| j j| j jf S )N�%s: %s)r �status�reason)r r r r �__str__@ s zUnexpectedResponseError.__str__N�r r r r r r r r r r = s c @ s e Zd ZdZdd� ZdS )r z+An HTTP non-2xx response code was received.c C s8 d� dd� t| j�� �D ��}d| jj| jj|| jf S )z9Show the error code, response headers, and response body.�
c S s g | ]}d | �qS )r r )�.0Zpairr r r �
<listcomp>I s �z%HTTPError.__str__.<locals>.<listcomp>zIHTTP Error %s: %s
Response headers:
---
%s
---
Response body:
---
%s
---
)�join�sortedr �itemsr r r )r Zheadersr r r r G s
� ��zHTTPError.__str__Nr r r r r r D s c @ s e Zd ZdZdS )r z.An exception representing a client-side error.Nr r r r r r Q s c @ s e Zd ZdZdS )r
z4An exception representing an authentication failure.Nr r r r r r
U s c @ s e Zd ZdZdS )r z1An exception representing a nonexistent resource.Nr r r r r r Y s c @ s e Zd ZdZdS )r z�An 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 c @ s e Zd ZdZdS )r z:An exception representing a problem with a client request.Nr r r r r r e s c @ s e Zd ZdZdS )r z9An exception representing a conflict with another client.Nr r r r r r i s c @ s e Zd ZdZdS )r z�An 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 m s c @ s e Zd ZdZdS )r z.An exception representing a server-side error.Nr r r r r r u s c C sj t tttttd�}| jd dkr$dS |�| jt�}|tkr`| jd dkrNt }n| jd dkr`t
}|| |�S )z�Turn 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 Zhttp_errors_by_status_code�clsr r r � error_fory s � r+ N)r �typeZ
__metaclass__�__all__� Exceptionr
r r r r r r r
r r r r r r r+ r r r r �<module> s>