3 �Pf��@sLddlmZddlmZGdd�de�ZGdd�de�ZGdd �d e�Z Gd d �d e �Z Gd d �d e�Z Gdd�de�Z Gdd�de�Z Gdd�de�ZeZGdd�de �ZGdd�de �ZGdd�de�ZGdd�de�ZGdd�dee �ZGdd�de�ZGd d!�d!ee �ZGd"d#�d#e �ZGd$d%�d%e �ZGd&d'�d'ee�ZGd(d)�d)e�ZGd*d+�d+e�ZGd,d-�d-e�ZGd.d/�d/e�ZGd0d1�d1e�ZGd2d3�d3e�Z Gd4d5�d5e�Z!Gd6d7�d7e�Z"Gd8d9�d9e�Z#Gd:d;�d;ee�Z$Gdd?�d?ee�ZGd@dA�dAe�Z&GdBdC�dCe'e�Z(GdDdE�dEe�Z)GdFdG�dGe�Z*dHS)I�)�absolute_import�)�IncompleteReadc@seZdZdZdS)� HTTPErrorz#Base exception used by this module.N)�__name__� __module__� __qualname__�__doc__�r r � /usr/lib/python3.6/exceptions.pyrsrc@seZdZdZdS)� HTTPWarningz!Base warning used by this module.N)rrrr r r r r r sr c@s eZdZdZdd�Zdd�ZdS)� PoolErrorz/Base exception for errors caused within a pool.cCs||_tj|d||f�dS)Nz%s: %s)�poolr�__init__)�selfr�messager r r rszPoolError.__init__cCs |jdfS)N)NN)� __class__)rr r r � __reduce__szPoolError.__reduce__N)rrrr rrr r r r r sr c@s eZdZdZdd�Zdd�ZdS)� RequestErrorz8Base exception for PoolErrors that have associated URLs.cCs||_tj|||�dS)N)�urlr r)rrrrr r r rszRequestError.__init__cCs|jd|jdffS)N)rr)rr r r r#szRequestError.__reduce__N)rrrr rrr r r r rsrc@seZdZdZdS)�SSLErrorz9Raised when SSL certificate fails in an HTTPS connection.N)rrrr r r r r r(src@seZdZdZdS)� ProxyErrorz,Raised when the connection to a proxy fails.N)rrrr r r r r r-src@seZdZdZdS)� DecodeErrorz;Raised when automatic decoding based on Content-Type fails.N)rrrr r r r r r2src@seZdZdZdS)� ProtocolErrorz>Raised when something unexpected happens mid-request/response.N)rrrr r r r r r7src@seZdZdZddd�ZdS)� MaxRetryErrora Raised when the maximum number of retries is exceeded. :param pool: The connection pool :type pool: :class:`~urllib3.connectionpool.HTTPConnectionPool` :param string url: The requested Url :param exceptions.Exception reason: The underlying error NcCs&||_d||f}tj||||�dS)Nz0Max retries exceeded with url: %s (Caused by %r))�reasonrr)rrrrrr r r rLs zMaxRetryError.__init__)N)rrrr rr r r r rBsrc@seZdZdZddd�ZdS)�HostChangedErrorz?Raised when an existing pool gets a request for a foreign host.�cCs"d|}tj||||�||_dS)Nz)Tried to open a foreign host with url: %s)rr�retries)rrrrrr r r rXszHostChangedError.__init__N)r)rrrr rr r r r rUsrc@seZdZdZdS)�TimeoutStateErrorz3 Raised when passing an invalid state to a timeout N)rrrr r r r r r^src@seZdZdZdS)� TimeoutErrorz� Raised when a socket timeout error occurs. Catching this error will catch both :exc:`ReadTimeoutErrors ` and :exc:`ConnectTimeoutErrors `. N)rrrr r r r r r csr c@seZdZdZdS)�ReadTimeoutErrorzFRaised when a socket timeout occurs while receiving data from a serverN)rrrr r r r r r!lsr!c@seZdZdZdS)�ConnectTimeoutErrorz@Raised when a socket timeout occurs while connecting to a serverN)rrrr r r r r r"ssr"c@seZdZdZdS)�NewConnectionErrorzHRaised when we fail to establish a new connection. Usually ECONNREFUSED.N)rrrr r r r r r#xsr#c@seZdZdZdS)�EmptyPoolErrorzCRaised when a pool runs out of connections and no more are allowed.N)rrrr r r r r r$}sr$c@seZdZdZdS)�ClosedPoolErrorzCRaised when a request enters a pool after the pool has been closed.N)rrrr r r r r r%�sr%c@seZdZdZdS)�LocationValueErrorzsH