
                            S r SSKJr  SSKJr  SSKJr  SSKJr   " S S\R                  5      r " S S	\R                  5      r	 " S
 S\	5      r
 " S S\	5      r " S S\	5      r " S S\	5      r " S S\R                  5      r " S S\R                  5      r " S S\R                  5      r " S S\R                  5      r " S S\R                  5      r " S S\R                  5      r " S S\R                  5      r " S  S!\R                  5      r " S" S#\R                  5      r " S$ S%\R                  5      r " S& S'\R                  5      r " S( S)\R                  5      r " S* S+\R                  5      rg,)-z0This module holds exceptions raised by commands.    )absolute_import)division)unicode_literals)
exceptionsc                       \ rS rSrSrg)NoAppIdentifiedError    N)__name__
__module____qualname____firstlineno____static_attributes__r
       0lib/googlecloudsdk/command_lib/app/exceptions.pyr   r      s    r   r   c                       \ rS rSrSrSrg)DeployError   z#Base class for app deploy failures.r
   Nr   r   r   r   __doc__r   r
   r   r   r   r      s    +r   r   c                   2   ^  \ rS rSrSrU 4S jrS rSrU =r$ )RepoInfoLoadError!   z2Indicates a failure to load a source context file.c                 B   > [         [        U ]  5         Xl        X l        g N)superr   __init__filenameinner_exception)selfr   r   	__class__s      r   r   RepoInfoLoadError.__init__$   s    	
T+-M*r   c                 N    SR                  U R                  U R                  5      $ )Nz&Could not read repo info file {0}: {1})formatr   r   r    s    r   __str__RepoInfoLoadError.__str__)   s$    3::t++- -r   )r   r   	r   r   r   r   r   r   r&   r   __classcell__r!   s   @r   r   r   !   s    :+
- -r   r   c                       \ rS rSrSrS rSrg)MultiDeployError.   z9Indicates a failed attempt to deploy multiple image urls.c                     g)NzQNo more than one service may be deployed when using the image-url or appyaml flagr
   r%   s    r   r&   MultiDeployError.__str__1   s    (r   r
   Nr   r   r   r   r   r&   r   r
   r   r   r,   r,   .   s
    A)r   r,   c                       \ rS rSrSrS rSrg)NoRepoInfoWithImageUrlError6   z?The user tried to specify a repo info file with a docker image.c                     g)Nz?The --repo-info-file option is not compatible with --image_url.r
   r%   s    r   r&   #NoRepoInfoWithImageUrlError.__str__9   s    Lr   r
   Nr0   r
   r   r   r2   r2   6   s    GMr   r2   c                   2   ^  \ rS rSrSrU 4S jrS rSrU =r$ )DefaultBucketAccessError=   z@Indicates a failed attempt to access a project's default bucket.c                 6   > [         [        U ]  5         Xl        g r   )r   r7   r   projectr    r:   r!   s     r   r   !DefaultBucketAccessError.__init__@   s    	
"D24Lr   c                 4    SR                  U R                  S9$ )NztCould not retrieve the default Google Cloud Storage bucket for [{a}]. Please try again or use the [bucket] argument.)ar$   r:   r%   s    r   r&    DefaultBucketAccessError.__str__D   s    	9:@&4<<&:PQr   r:   r(   r*   s   @r   r7   r7   =   s    HQ Qr   r7   c                   $    \ rS rSrSrS rS rSrg)InvalidVersionIdErrorJ   z Indicates an invalid version ID.c                     Xl         g r   version)r    rG   s     r   r   InvalidVersionIdError.__init__M       Lr   c                 4    SR                  U R                  S9$ )NzInvalid version id [{version}].  May only contain lowercase letters, digits, and hyphens. Must begin and end with a letter or digit. Must not exceed 63 characters.rF   )r$   rG   r%   s    r   r&   InvalidVersionIdError.__str__P   s    	$%+VDLLV%ABr   rF   Nr   r   r   r   r   r   r&   r   r
   r   r   rC   rC   J   s    (Br   rC   c                   $    \ rS rSrSrS rS rSrg)MissingApplicationErrorW   z4If an app does not exist within the current project.c                     Xl         g r   rA   )r    r:   s     r   r    MissingApplicationError.__init__Z   rI   r   c                 8    SR                  U R                  5      $ )NzThe current Google Cloud project [{0}] does not contain an App Engine application. Use `gcloud app create` to initialize an App Engine application within the project.r?   r%   s    r   r&   MissingApplicationError.__str__]   s    	*+16$,,+?@r   rA   NrL   r
   r   r   rN   rN   W   s    <@r   rN   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )MissingInstanceErrord   z6An instance required for the operation does not exist.c                 J   > [         [        U ]  SR                  U5      5        g )NzInstance [{}] does not exist.)r   rU   r   r$   )r    instancer!   s     r   r   MissingInstanceError.__init__g   s!    	
.'..x8:r   r
   r   r   r   r   r   r   r   r)   r*   s   @r   rU   rU   d   s    >: :r   rU   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )MissingVersionErrorl   z4A version required for the operation does not exist.c                 J   > [         [        U ]  SR                  U5      5        g )NzVersion [{}] does not exist.)r   r\   r   r$   )r    rG   r!   s     r   r   MissingVersionError.__init__o   s!    	
t-&--g68r   r
   rZ   r*   s   @r   r\   r\   l   s    <8 8r   r\   c                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )InvalidInstanceTypeErrort   z#Instance has the wrong environment.c                 l   > SR                  U5      nU(       a  USU-   -  n[        [        U ]  U5        g )Nz+{} instances do not support this operation.z  )r$   r   ra   r   )r    environmentmessagemsgr!   s       r   r   !InvalidInstanceTypeError.__init__w   s4    
7
>
>{
KC	TG^c	
"D237r   r
   r   rZ   r*   s   @r   ra   ra   t   s    +8 8r   ra   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )FileNotFoundError~   z:File or directory that was supposed to exist didn't exist.c                 J   > [         [        U ]  SR                  U5      5        g )Nz[{}] does not exist.)r   ri   r   r$   r    pathr!   s     r   r   FileNotFoundError.__init__   s    	
T+,B,I,I$,OPr   r
   rZ   r*   s   @r   ri   ri   ~   s    BQ Qr   ri   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )DuplicateConfigError   z"Two config files of the same type.c                 H   > [         [        U ]  SR                  XUS95        g )Nz[{path1}] and [{path2}] are both trying to define a {t} config file. Only one config file of the same type can be updated at once.)path1path2t)r   rp   r   r$   )r    rs   rt   config_typer!   s       r   r   DuplicateConfigError.__init__   s0    	
.	HHN IO I56r   r
   rZ   r*   s   @r   rp   rp      s    *6 6r   rp   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )DuplicateServiceError   z6Two <service>.yaml files defining the same service id.c                 H   > [         [        U ]  SR                  XUS95        g )Nzv[{path1}] and [{path2}] are both defining the service id [{s}]. All <service>.yaml files must have unique service ids.)rs   rt   s)r   ry   r   r$   )r    rs   rt   
service_idr!   s       r   r   DuplicateServiceError.__init__   s0    	
/	AAG
 BH B45r   r
   rZ   r*   s   @r   ry   ry      s    >5 5r   ry   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )UnknownSourceError   z;The path exists but points to an unknown file or directory.c                 F   > [         [        U ]  SR                  US95        g )NzE[{path}] could not be identified as a valid source directory or file.)rm   )r   r   r   r$   rl   s     r   r   UnknownSourceError.__init__   s"    	
d,O	T	r   r
   rZ   r*   s   @r   r   r      s    C r   r   c                       \ rS rSrSrSrg)NotSupportedPy3Exception   z%Commands that do not support python3.r
   Nr   r
   r   r   r   r      s    -r   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )UnsupportedRuntimeError   z5The runtime in app.yaml is not a valid Gen 1 runtime.c                 >   > [         TU ]  SR                  XS95        g )NzmMigration is not supported for runtime present in [{file_path}]. Currently supported runtimes are: {runtimes})	file_pathruntimesr   r   r$   )r    r   supported_runtimesr!   s      r   r    UnsupportedRuntimeError.__init__   s'    	G	88> 9? 9
r   r
   rZ   r*   s   @r   r   r      s    = r   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )InvalidOutputDirectoryError   z6The output directory given for migration is not empty.c                 >   > [         TU ]  SR                  US95        g )NzUnable to write to output directory [{dir_path}]. The directory is not empty. Please provide an empty directory to start a new migration.)dir_pathr   )r    r   r!   s     r   r   $InvalidOutputDirectoryError.__init__   s"    	G	N		"r   r
   rZ   r*   s   @r   r   r      s    > r   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )MissingGen1ApplicationError   zFThe project does not contain an AppEngine version with a Gen1 runtime.c                 B   > [         TU ]  SR                  U5      5        g )NzSThe provided project {0} does not contain an AppEngine version with a Gen1 runtime.r   r;   s     r   r   $MissingGen1ApplicationError.__init__   s    	G	r   r
   rZ   r*   s   @r   r   r      s    N r   r   N)r   
__future__r   r   r   googlecloudsdk.corer   Errorr   r   r   r,   r2   r7   rC   rN   rU   r\   ra   ri   rp   ry   r   r   r   r   r   r
   r   r   <module>r      s^    7 &  ' *:++ ,*"" ,
- 
-){ )M+ M
Q{ 
Q
BJ,, 
B
@j.. 
@::++ :8*** 88z// 8Q
(( Q6:++ 65J,, 5)) .z// .	j.. 	*"2"2 *"2"2 r   