HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //proc/1233/cwd/usr/lib/python3/dist-packages/docker/__pycache__/errors.cpython-310.pyc
o

�2.a&�@sTddlZGdd�de�Zdd�ZGdd�dejje�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�Z	Gdd�de�Z
Gdd�de�ZGdd�de�ZGdd�de�Z
Gdd�de�ZGdd�dee�ZGdd�de�ZGdd�de�ZGdd�de�ZGd d!�d!e�Zd"d#�ZGd$d%�d%e�ZGd&d'�d'e�ZGd(d)�d)e�ZGd*d+�d+e�ZdS),�Nc@seZdZdZdS)�DockerExceptionz�
    A base class from which all other exceptions inherit.

    If you want to catch all errors that the Docker SDK might raise,
    catch this base exception.
    N)�__name__�
__module__�__qualname__�__doc__�rr�//usr/lib/python3/dist-packages/docker/errors.pyrsrcCs�|j}z|��d}Wnty|jpd��}Ynwt}|jdkr<|r:dt|�vs7dt|�vs7dt|�vr:t}nt	}||||d��)zH
    Create a suitable APIError from requests.exceptions.HTTPError.
    �message�i�z
No such imagez+not found: does not exist or no pull accesszrepository does not exist)�response�explanation)
r�json�
ValueError�content�strip�APIError�status_code�str�
ImageNotFound�NotFound)�err�clsrrr�$create_api_error_from_http_exception
s �
�rcsReZdZdZd�fdd�	Z�fdd�Zedd��Zd	d
�Zdd�Z	d
d�Z
�ZS)rz%
    An HTTP error from the API.
    Ncst��|�||_||_dS�N)�super�__init__rr)�selfr	rr��	__class__rrr&s
zAPIError.__init__cslt���}|��rd�|jj|jj|jj�}n|��r(d�|jj|jj|jj�}|j	r4|�d|j	�d�}|S)Nz{} Client Error for {}: {}z{} Server Error for {}: {}z ("z"))
r�__str__�is_client_error�formatrr�url�reason�is_server_errorr)rr	rrrr-s
��zAPIError.__str__cCs|jdur	|jjSdSr)rr�rrrrr?s
�zAPIError.status_codecCs|��p|��Sr)r r$r%rrr�is_errorDszAPIError.is_errorcC�(|jdurdSd|jkodkSS)NFi����rr%rrrr G�
zAPIError.is_client_errorcCr')NFr(iXr)r%rrrr$Lr*zAPIError.is_server_error)NN)rrrrrr�propertyrr&r r$�
__classcell__rrrrr"s
rc@�eZdZdS)rN�rrrrrrrrR�rc@r-)rNr.rrrrrVr/rc@r-)�InvalidVersionNr.rrrrr0Zr/r0c@r-)�InvalidRepositoryNr.rrrrr1^r/r1c@r-)�InvalidConfigFileNr.rrrrr2br/r2c@r-)�InvalidArgumentNr.rrrrr3fr/r3c@r-)�DeprecatedMethodNr.rrrrr4jr/r4c@�eZdZdd�Zdd�ZdS)�TLSParameterErrorcC�
||_dSr��msg�rr9rrrro�
zTLSParameterError.__init__cCs
|jdS)Nz�. TLS configurations should map the Docker CLI client configurations. See https://docs.docker.com/engine/articles/https/ for API details.r8r%rrrrrr;zTLSParameterError.__str__N�rrrrrrrrrr6n�r6c@r-)�NullResourceNr.rrrrr>yr/r>cs eZdZdZ�fdd�Z�ZS)�ContainerErrorzK
    Represents a container that has exited with a non-zero exit code.
    csT||_||_||_||_||_|durd|��nd}d�||||�}t��|�dS)Nz: r
z=Command '{}' in image '{}' returned non-zero exit status {}{})�	container�exit_status�command�image�stderrr!rr)rr@rArBrCrD�errr9rrrr�s�zContainerError.__init__)rrrrrr,rrrrr?}sr?c@seZdZdd�ZdS)�StreamParseErrorcCr7rr8)rr#rrrr�r;zStreamParseError.__init__N)rrrrrrrrrF�srFcseZdZ�fdd�Z�ZS)�
BuildErrorcst��|�||_||_dSr)rrr9�	build_log)rr#rHrrrr�s
zBuildError.__init__)rrrrr,rrrrrG�srGc@r-)�ImageLoadErrorNr.rrrrrI�r/rIcCs^dd�t|�D�}|�d�g}t|�dkr|�d�n|�d�|�d�|��td�|��S)	NcSsg|]}d|�d��qS)�'r)�.0�krrr�
<listcomp>�sz2create_unexpected_kwargs_error.<locals>.<listcomp>z() �z#got an unexpected keyword argument z!got unexpected keyword arguments z, r
)�sorted�len�append�join�	TypeError)�name�kwargs�
quoted_kwargs�textrrr�create_unexpected_kwargs_error�s
rXc@r5)�MissingContextParametercCr7r��param)rr[rrrr�r;z MissingContextParameter.__init__cCsd|j��S)Nzmissing parameter: rZr%rrrr�szMissingContextParameter.__str__Nr<rrrrrY�r=rYc@r5)�ContextAlreadyExistscCr7r�rT�rrTrrrr�r;zContextAlreadyExists.__init__cC�d|j�d�S)Nzcontext z already existsr]r%rrrr��zContextAlreadyExists.__str__Nr<rrrrr\�r=r\c@r5)�ContextExceptioncCr7rr8r:rrrr�r;zContextException.__init__cCs|jSrr8r%rrrr�szContextException.__str__Nr<rrrrra�r=rac@r5)�ContextNotFoundcCr7rr]r^rrrr�r;zContextNotFound.__init__cCr_)Nz	context 'z' not foundr]r%rrrr�r`zContextNotFound.__str__Nr<rrrrrb�r=rb)�requests�	Exceptionrr�
exceptions�	HTTPErrorrrrr0r1r2r3r4r6rr>r?�RuntimeErrorrFrGrIrXrYr\rarbrrrr�<module>s,	0