
                            S SK r \" S S 5       5      r " S S\5      rS r " S S\ R                  R                  \5      r " S	 S
\5      r	 " S S\	5      r
 " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\\5      r " S S\5      r " S S\5      r " S S \5      r " S! S"\5      rS# r " S$ S%\5      r " S& S'\5      r " S( S)\5      r " S* S+\5      rg),    Nc              #   @   #    U  H  oR                  5       v   M     g 7fN)lower).0fragments      lib/third_party/docker/errors.py	<genexpr>r	      s       3&NN &s   )zno such imagez+not found: does not exist or no pull accesszrepository does not existz3was found but does not match the specified platformc                       \ rS rSrSrSrg)DockerException   z
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____firstlineno____doc____static_attributes__r       r   r   r      s    r   r   c                 n  ^ U R                   n UR                  5       S   n[
        nUR                  S:X  aD  U=(       d    SR                  5       m[        U4S j[         5       5      (       a  [        nO[        nU" XUS9U e! [         a&    UR                  =(       d    SR	                  5       n Nf = f)z@
Create a suitable APIError from requests.exceptions.HTTPError.
message i  c              3   .   >#    U  H
  nUT;   v   M     g 7fr   r   )r   r   explanation_msgs     r   r	   7create_api_error_from_http_exception.<locals>.<genexpr>"   s      GE8 ?*Es   )responseexplanation)r   json
ValueErrorcontentstripAPIErrorstatus_coder   any&_image_not_found_explanation_fragmentsImageNotFoundNotFound)er   r   clsr   s       @r   $create_api_error_from_http_exceptionr)      s     zzH7mmoi0 Cs"&,"335 GEG G GCC
a
<!C  7''-24467s   B -B43B4c                   ^   ^  \ rS rSrSrS
U 4S jjrU 4S jr\S 5       rS r	S r
S rS	rU =r$ )r!   *   z
An HTTP error from the API.
c                 <   > [         TU ]  U5        X l        X0l        g r   )super__init__r   r   )selfr   r   r   	__class__s       r   r.   APIError.__init__.   s     	! &r   c                   > [         TU ]  5       nU R                  5       (       aP  SR                  U R                  R
                  U R                  R                  U R                  R                  5      nOdU R                  5       (       aO  SR                  U R                  R
                  U R                  R                  U R                  R                  5      nU R                  (       a  U SU R                   S3nU$ )Nz{} Client Error for {}: {}z{} Server Error for {}: {}z ("z"))
r-   __str__is_client_errorformatr   r"   urlreasonis_server_errorr   )r/   r   r0   s     r   r3   APIError.__str__5   s    '/#!!299))4==+<+<$$&G !!##299))4==+<+<$$&G  	T%5%5$6b9Gr   c                 J    U R                   b  U R                   R                  $ g r   )r   r"   r/   s    r   r"   APIError.status_codeG   s!    ==$==,,, %r   c                 P    U R                  5       =(       d    U R                  5       $ r   )r4   r8   r;   s    r   is_errorAPIError.is_errorL   s    ##%?)=)=)??r   c                 \    U R                   c  gSU R                   s=:*  =(       a    S:  $ s  $ )NFi    r"   r;   s    r   r4   APIError.is_client_errorO   0    #d&&,,,,,,r   c                 \    U R                   c  gSU R                   s=:*  =(       a    S:  $ s  $ )NFrA   iX  rB   r;   s    r   r8   APIError.is_server_errorT   rD   r   )r   r   )NN)r   r   r   r   r   r.   r3   propertyr"   r>   r4   r8   r   __classcell__r0   s   @r   r!   r!   *   s;    '$ - -@-
- -r   r!   c                       \ rS rSrSrg)r&   Z   r   Nr   r   r   r   r   r   r   r   r&   r&   Z       r   r&   c                       \ rS rSrSrg)r%   ^   r   NrL   r   r   r   r%   r%   ^   rM   r   r%   c                       \ rS rSrSrg)InvalidVersionb   r   NrL   r   r   r   rQ   rQ   b   rM   r   rQ   c                       \ rS rSrSrg)InvalidRepositoryf   r   NrL   r   r   r   rT   rT   f   rM   r   rT   c                       \ rS rSrSrg)InvalidConfigFilej   r   NrL   r   r   r   rW   rW   j   rM   r   rW   c                       \ rS rSrSrg)InvalidArgumentn   r   NrL   r   r   r   rZ   rZ   n   rM   r   rZ   c                       \ rS rSrSrg)DeprecatedMethodr   r   NrL   r   r   r   r]   r]   r   rM   r   r]   c                        \ rS rSrS rS rSrg)TLSParameterErrorv   c                     Xl         g r   msgr/   rd   s     r   r.   TLSParameterError.__init__w       r   c                      U R                   S-   $ )Nz. TLS configurations should map the Docker CLI client configurations. See https://docs.docker.com/engine/articles/https/ for API details.rc   r;   s    r   r3   TLSParameterError.__str__z   s    xx . / 	/r   rc   Nr   r   r   r   r.   r3   r   r   r   r   r`   r`   v   s    /r   r`   c                       \ rS rSrSrg)NullResource   r   NrL   r   r   r   rl   rl      rM   r   rl   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )ContainerError   zC
Represents a container that has exited with a non-zero exit code.
c                    > Xl         X l        X0l        X@l        XPl        Ub  SU 3OSnSR                  X4X&5      n[        TU ]  U5        g )Nz: r   z=Command '{}' in image '{}' returned non-zero exit status {}{})	containerexit_statuscommandimagestderrr5   r-   r.   )	r/   rr   rs   rt   ru   rv   errrd   r0   s	           r   r.   ContainerError.__init__   sT    "&
%16(mr$fW[F 	 	r   )rt   rr   rs   ru   rv   )r   r   r   r   r   r.   r   rH   rI   s   @r   ro   ro      s     r   ro   c                       \ rS rSrS rSrg)StreamParseError   c                     Xl         g r   rc   )r/   r7   s     r   r.   StreamParseError.__init__   s    r   rc   N)r   r   r   r   r.   r   r   r   r   rz   rz      s    r   rz   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )
BuildError   c                 <   > [         TU ]  U5        Xl        X l        g r   )r-   r.   rd   	build_log)r/   r7   r   r0   s      r   r.   BuildError.__init__   s     "r   )r   rd   )r   r   r   r   r.   r   rH   rI   s   @r   r   r      s    # #r   r   c                       \ rS rSrSrg)ImageLoadError   r   NrL   r   r   r   r   r      rM   r   r   c                 .   [        U5       Vs/ s H	  nSU S3PM     nnU  S3/n[        U5      S:X  a  UR                  S5        OUR                  S5        UR                  SR                  U5      5        [	        SR                  U5      5      $ s  snf )N'z()    z#got an unexpected keyword argument z!got unexpected keyword arguments z, r   )sortedlenappendjoin	TypeError)namekwargskquoted_kwargstexts        r   create_unexpected_kwargs_errorr      s    '-f~6~!q1X~M6fCL>D
=Q9:78KK		-()RWWT]## 7s   Bc                        \ rS rSrS rS rSrg)MissingContextParameter   c                     Xl         g r   param)r/   r   s     r   r.    MissingContextParameter.__init__   s    
r   c                      SU R                    3$ )Nzmissing parameter: r   r;   s    r   r3   MissingContextParameter.__str__   s    %djj\23r   r   Nrj   r   r   r   r   r      s    4r   r   c                        \ rS rSrS rS rSrg)ContextAlreadyExists   c                     Xl         g r   r   r/   r   s     r   r.   ContextAlreadyExists.__init__       	r   c                 "    SU R                    S3$ )Nzcontext z already existsr   r;   s    r   r3   ContextAlreadyExists.__str__   s    499+_56r   r   Nrj   r   r   r   r   r      s    7r   r   c                        \ rS rSrS rS rSrg)ContextException   c                     Xl         g r   rc   re   s     r   r.   ContextException.__init__   rg   r   c                     U R                   $ r   rc   r;   s    r   r3   ContextException.__str__   s    r   rc   Nrj   r   r   r   r   r      s    r   r   c                        \ rS rSrS rS rSrg)ContextNotFound   c                     Xl         g r   r   r   s     r   r.   ContextNotFound.__init__   r   r   c                 "    SU R                    S3$ )Nz	context 'z' not foundr   r;   s    r   r3   ContextNotFound.__str__   s    DII;k23r   r   Nrj   r   r   r   r   r      s    4r   r   )requests	frozensetr$   	Exceptionr   r)   
exceptions	HTTPErrorr!   r&   r%   rQ   rT   rW   rZ   r]   r`   r   rl   ro   RuntimeErrorrz   r   r   r   r   r   r   r   r   r   r   <module>r      s"   )2 3&3 * &i D(--x"",,o --`	x 		H 		_ 		 		 		o 		 	/ /	?J 	_ $| 
# #	_ 	$4o 47? 7 4o 4r   