
                            S 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.    )
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__.   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)NoRepoInfoWithImageUrlError3   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__6   s    Lr   r   Nr-   r   r   r   r/   r/   3   s    GMr   r/   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   r4   r   projectr   r7   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!   r7   r"   s    r   r#    DefaultBucketAccessError.__str__A   s    	9:@&4<<&:PQr   r7   r%   r'   s   @r   r4   r4   :   s    HQ Qr   r4   c                   $    \ rS rSrSrS rS rSrg)InvalidVersionIdErrorG   z Indicates an invalid version ID.c                     Xl         g r   version)r   rD   s     r   r   InvalidVersionIdError.__init__J       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.rC   )r!   rD   r"   s    r   r#   InvalidVersionIdError.__str__M   s    	$%+VDLLV%ABr   rC   Nr   r	   r
   r   r   r   r#   r   r   r   r   r@   r@   G   s    (Br   r@   c                   $    \ rS rSrSrS rS rSrg)MissingApplicationErrorT   z4If an app does not exist within the current project.c                     Xl         g r   r>   )r   r7   s     r   r    MissingApplicationError.__init__W   rF   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__Z   s    	*+16$,,+?@r   r>   NrI   r   r   r   rK   rK   T   s    <@r   rK   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )MissingInstanceErrora   z6An instance required for the operation does not exist.c                 J   > [         [        U ]  SR                  U5      5        g )NzInstance [{}] does not exist.)r   rR   r   r!   )r   instancer   s     r   r   MissingInstanceError.__init__d   s!    	
.'..x8:r   r   r   r	   r
   r   r   r   r   r&   r'   s   @r   rR   rR   a   s    >: :r   rR   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )MissingVersionErrori   z4A version required for the operation does not exist.c                 J   > [         [        U ]  SR                  U5      5        g )NzVersion [{}] does not exist.)r   rY   r   r!   )r   rD   r   s     r   r   MissingVersionError.__init__l   s!    	
t-&--g68r   r   rW   r'   s   @r   rY   rY   i   s    <8 8r   rY   c                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )InvalidInstanceTypeErrorq   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   r^   r   )r   environmentmessagemsgr   s       r   r   !InvalidInstanceTypeError.__init__t   s4    
7
>
>{
KC	TG^c	
"D237r   r   r   rW   r'   s   @r   r^   r^   q   s    +8 8r   r^   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   rf   r   r!   r   pathr   s     r   r   FileNotFoundError.__init__~   s    	
T+,B,I,I$,OPr   r   rW   r'   s   @r   rf   rf   {   s    BQ Qr   rf   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   rm   r   r!   )r   rp   rq   config_typer   s       r   r   DuplicateConfigError.__init__   s0    	
.	HHN IO I56r   r   rW   r'   s   @r   rm   rm      s    *6 6r   rm   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.)rp   rq   s)r   rv   r   r!   )r   rp   rq   
service_idr   s       r   r   DuplicateServiceError.__init__   s0    	
/	AAG
 BH B45r   r   rW   r'   s   @r   rv   rv      s    >5 5r   rv   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.)rj   )r   r}   r   r!   ri   s     r   r   UnknownSourceError.__init__   s"    	
d,O	T	r   r   rW   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   rW   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   rW   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   r8   s     r   r   $MissingGen1ApplicationError.__init__   s    	G	r   r   rW   r'   s   @r   r   r      s    N r   r   N)r   googlecloudsdk.corer   Errorr   r   r   r)   r/   r4   r@   rK   rR   rY   r^   rf   rm   rv   r}   r   r   r   r   r   r   r   <module>r      sW    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   