U
    [e                     @   s  d Z eZddddddddd	d
ddddgZG dd
 d
eZG dd deZG dd deZG dd deZG dd deZ	G dd deZ
G dd de
ZG dd deZG dd deZG dd deZG dd deZG dd deZG dd	 d	eZG dd de
Zdd ZdS ) zlazr.restfulclient errors.
BadRequestConflictClientErrorCredentialsErrorCredentialsFileError	HTTPErrorMethodNotAllowedNotFoundPreconditionFailedRestfulErrorResponseErrorServerErrorUnauthorizedUnexpectedResponseErrorc                   @   s   e Zd ZdZdS )r
   z2Base error for the lazr.restfulclient API library.N__name__
__module____qualname____doc__ r   r   [/var/www/html/services/stratfitenv/lib/python3.8/site-packages/lazr/restfulclient/errors.pyr
   (   s   c                   @   s   e Zd ZdZdS )r   z&Base credentials/authentication error.Nr   r   r   r   r   r   ,   s   c                   @   s   e Zd ZdZdS )r   zError in credentials file.Nr   r   r   r   r   r   0   s   c                   @   s   e Zd ZdZdd ZdS )r   zError in response.c                 C   s   t |  || _|| _d S )N)r
   __init__responsecontent)selfr   r   r   r   r   r   7   s    
zResponseError.__init__N)r   r   r   r   r   r   r   r   r   r   4   s   c                   @   s   e Zd ZdZdd ZdS )r   z$An unexpected response was received.c                 C   s   d| j j| j jf S )N%s: %s)r   statusreason)r   r   r   r   __str__@   s    zUnexpectedResponseError.__str__Nr   r   r   r   r   r   r   r   r   r   =   s   c                   @   s   e Zd ZdZdd ZdS )r   z+An HTTP non-2xx response code was received.c                 C   s8   d dd t| j D }d| jj| jj|| jf S )z9Show the error code, response headers, and response body.
c                 S   s   g | ]}d | qS )r   r   ).0pairr   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   headersr   r   r   r   G   s    
   zHTTPError.__str__Nr   r   r   r   r   r   D   s   c                   @   s   e Zd ZdZdS )r   z.An exception representing a client-side error.Nr   r   r   r   r   r   Q   s   c                   @   s   e Zd ZdZdS )r   z4An exception representing an authentication failure.Nr   r   r   r   r   r   U   s   c                   @   s   e Zd ZdZdS )r   z1An exception representing a nonexistent resource.Nr   r   r   r   r   r   Y   s   c                   @   s   e Zd ZdZdS )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   c                   @   s   e Zd ZdZdS )r   z:An exception representing a problem with a client request.Nr   r   r   r   r   r   e   s   c                   @   s   e Zd ZdZdS )r   z9An exception representing a conflict with another client.Nr   r   r   r   r   r   i   s   c                   @   s   e Zd ZdZdS )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	   m   s   c                   @   s   e Zd ZdZdS )r   z.An exception representing a server-side error.Nr   r   r   r   r   r   u   s   c                 C   sj   t tttttd}| jd dkr$dS || jt}|tkr`| jd dkrNt	}n| jd 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   Zhttp_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>   	