U .Ѫ_@s\ddlmZddlmZGdddeZGdddeZGdd d eZ Gd d d e Z Gd d d eZ GdddeZ GdddeZ GdddeZeZGddde ZGddde ZGdddeZGdddeZGdddee ZGdddeZGd d!d!ee ZGd"d#d#e ZGd$d%d%e ZGd&d'd'eeZGd(d)d)eZGd*d+d+eZGd,d-d-eZGd.d/d/eZGd0d1d1eZGd2d3d3eZ Gd4d5d5eZ!Gd6d7d7eZ"Gd8d9d9eZ#Gd:d;d;eZ$Gdd?d?eZ&Gd@dAdAeeZGdBdCdCeZ'GdDdEdEe(eZ)GdFdGdGeZ*GdHdIdIeZ+dJS)K)absolute_import)IncompleteReadc@seZdZdZdS) HTTPErrorz#Base exception used by this module.N__name__ __module__ __qualname____doc__r r 9/Users/cjl/code/aws-vpc-ipam/lambda/urllib3/exceptions.pyrsrc@seZdZdZdS) HTTPWarningz!Base warning used by this module.Nrr r r r r sr c@s eZdZdZddZddZdS) PoolErrorz/Base exception for errors caused within a pool.cCs||_t|d||fdS)Nz%s: %s)poolr__init__)selfrmessager r r rszPoolError.__init__cCs |jdfS)N)NN __class__rr r r __reduce__szPoolError.__reduce__Nrrr r rrr r r r rsrc@s eZdZdZddZddZdS) RequestErrorz8Base exception for PoolErrors that have associated URLs.cCs||_t|||dSN)urlrr)rrrrr r r r szRequestError.__init__cCs|jd|jdffSr)rrrr r r r$szRequestError.__reduce__Nrr r r r rsrc@seZdZdZdS)SSLErrorz9Raised when SSL certificate fails in an HTTPS connection.Nrr r r r r)srcs eZdZdZfddZZS) ProxyErrorz,Raised when the connection to a proxy fails.cs"tt|j||f|||_dSr)superrrZoriginal_error)rrerrorargsrr r r1szProxyError.__init__rrr r r __classcell__r r rr r.src@seZdZdZdS) DecodeErrorz;Raised when automatic decoding based on Content-Type fails.Nrr r r r r"6sr"c@seZdZdZdS) ProtocolErrorz>Raised when something unexpected happens mid-request/response.Nrr r r r r#;sr#c@seZdZdZdddZdS) 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}t||||dS)Nz0Max retries exceeded with url: %s (Caused by %r))reasonrr)rrrr%rr r r rQs zMaxRetryError.__init__)Nrrr r rr r r r r$Gs r$c@seZdZdZdddZdS)HostChangedErrorz?Raised when an existing pool gets a request for a foreign host.cCs"d|}t||||||_dS)Nz)Tried to open a foreign host with url: %s)rrretries)rrrr)rr r r r\szHostChangedError.__init__N)r(r&r r r r r'Ysr'c@seZdZdZdS)TimeoutStateErrorz3 Raised when passing an invalid state to a timeout Nrr r r r r*bsr*c@seZdZdZdS) TimeoutErrorzRaised when a socket timeout error occurs. Catching this error will catch both :exc:`ReadTimeoutErrors ` and :exc:`ConnectTimeoutErrors `. Nrr r r r r+hsr+c@seZdZdZdS)ReadTimeoutErrorzFRaised when a socket timeout occurs while receiving data from a serverNrr r r r r,rsr,c@seZdZdZdS)ConnectTimeoutErrorz@Raised when a socket timeout occurs while connecting to a serverNrr r r r r-ysr-c@seZdZdZdS)NewConnectionErrorzHRaised when we fail to establish a new connection. Usually ECONNREFUSED.Nrr r r r r.~sr.c@seZdZdZdS)EmptyPoolErrorzCRaised when a pool runs out of connections and no more are allowed.Nrr r r r r/sr/c@seZdZdZdS)ClosedPoolErrorzCRaised when a request enters a pool after the pool has been closed.Nrr r r r r0sr0c@seZdZdZdS)LocationValueErrorzs r>c@seZdZdZdS)ResponseNotChunkedz;Response needs to be chunked in order to read it as chunks.Nrr r r r r?sr?c@seZdZdZdS)BodyNotHttplibCompatiblezz Body should be httplib.HTTPResponse like (have an fp attribute which returns raw chunks) for read_chunked(). Nrr r r r r@sr@cs(eZdZdZfddZddZZS)rz Response length doesn't match expected Content-Length Subclass of http_client.IncompleteRead to allow int value for `partial` to avoid creating large objects on streamed reads. cstt|||dSr)rrr)rpartialexpectedrr r rszIncompleteRead.__init__cCsd|j|jfS)Nz/IncompleteRead(%i bytes read, %i more expected))rArBrr r r __repr__szIncompleteRead.__repr__)rrr r rrCr!r r rr rs rc@seZdZdZdS) InvalidHeaderz(The header provided was somehow invalid.Nrr r r r rDsrDcs eZdZdZfddZZS)ProxySchemeUnknownz1ProxyManager does not support the supplied schemecsd|}tt||dS)NzNot supported proxy scheme %s)rrEr)rschemerrr r rszProxySchemeUnknown.__init__r r r rr rEsrEcs eZdZdZfddZZS)HeaderParsingErrorzNRaised by assert_header_parsing, but we convert it to a log.warning statement.cs$d|pd|f}tt||dS)Nz%s, unparsed data: %rUnknown)rrGr)rZdefectsZ unparsed_datarrr r r szHeaderParsingError.__init__r r r rr rGsrGc@seZdZdZdS)UnrewindableBodyErrorz9urllib3 encountered an error when trying to rewind a bodyNrr r r r rIsrIN), __future__rZpackages.six.moves.http_clientrZhttplib_IncompleteRead ExceptionrWarningr rrrrr"r#ConnectionErrorr$r'r*r+r,r-r.r/r0 ValueErrorr1r2r4r7r8r9r:r;r<r=r>r?r@rDAssertionErrorrErGrIr r r r sJ