
    v                        S r SSKJr  SSKJr  S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 " S S\R                  5      r " S  S!\R                  5      r " S" S#\R                  5      r " S$ S%\R.                  5      rg&)'z&Exceptions for cloud deploy libraries.    )
exceptionsz-Status code: {status_code}. {status_message}.c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )ParserError   z%Error parsing JSON into a dictionary.c                 L   > SR                  UUS9n[        [        U ]  U5        g)zoInitialize a exceptions.ParserError.

Args:
  path: str, build artifacts file path.
  msg: str, error message.
zparsing {path}: {msg})pathmsgN)formatsuperr   __init__)selfr   r	   	__class__s      3lib/googlecloudsdk/command_lib/deploy/exceptions.pyr   ParserError.__init__   s1     "
(
( ) C 
+t%c*     __name__
__module____qualname____firstlineno____doc__r   __static_attributes____classcell__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$ )ReleaseInactiveError)   z3Error when a release is not deployed to any target.c                 ,   > [         [        U ]  S5        g )NzThis release is not deployed to a target in the active delivery pipeline. Include the --to-target parameter to indicate which target to promote to.)r   r   r   r   r   s    r   r   ReleaseInactiveError.__init__,   s    	
.	r   r   r   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$ )AbandonedReleaseError4   z7Error when an activity happens on an abandoned release.c                 N   > SR                  X5      n[        [        U ]  U5        g )Nz{} Release {} is abandoned.)r
   r   r#   r   )r   	error_msgrelease_nameerror_templater   s       r   r   AbandonedReleaseError.__init__7   s(    299N 

/?r   r   r   r   s   @r   r#   r#   4   s    ?@ @r   r#   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )NoStagesError>   z9Error when a release doesn't contain any pipeline stages.c                 J   > [         [        U ]  SR                  U5      5        g )Nz%No pipeline stages in the release {}.)r   r+   r   r
   r   r'   r   s     r   r   NoStagesError.__init__A   s     	-'/66|Dr   r   r   r   s   @r   r+   r+   >   s    A r   r+   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )InvalidReleaseNameErrorG   zFError when a release has extra $ signs after expanding template terms.c                 N   > Sn[         [        U ]  UR                  X5      5        g )Nz_Invalid character '$' for release name '{}' at indices: {}. Did you mean to use $DATE or $TIME?)r   r1   r   r
   )r   r'   error_indicesr&   r   s       r   r    InvalidReleaseNameError.__init__J   s-    	3 
 

!415r   r   r   r   s   @r   r1   r1   G   s    N r   r1   c                   H    \ rS rSrSr\S 5       r\S 5       r\S 5       rSr	g)CloudDeployConfigErrorU   z8Error raised for errors in the cloud deploy yaml config.c                     U " SU SU 35      $ )NzError parsing manifest #z: r   )clsnummessages      r   for_unnamed_manifest+CloudDeployConfigError.for_unnamed_manifestX   s    )#b	:;;r   c                 $    U " SU SU SU 35      $ )NError parsing  "": r   )r:   kindnamer<   s       r   for_resource#CloudDeployConfigError.for_resource\   s     vRvS	:;;r   c           
      *    U " SU SU SU SU 35      $ )Nr@   rA   z	" field "rB   r   )r:   rC   rD   fieldr<   s        r   for_resource_field)CloudDeployConfigError.for_resource_field`   s&    vRvYugS	JKKr   r   N)
r   r   r   r   r   classmethodr=   rE   rI   r   r   r   r   r7   r7   U   sA    @< < < < L Lr   r7   c                       \ rS rSrSrSrg)ManifestTransformExceptione   z:Error raised when a manifest transform fails due to a bug.r   N)r   r   r   r   r   r   r   r   r   rM   rM   e   s    Br   rM   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )ListRolloutsErrori   zDError when it failed to list the rollouts that belongs to a release.c                 J   > [         [        U ]  SR                  U5      5        g )NzFailed to list rollouts for {}.)r   rP   r   r
   r.   s     r   r   ListRolloutsError.__init__l   s!    	
T+)00>r   r   r   r   s   @r   rP   rP   i   s    L r   rP   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )RedeployRolloutErrorr   z{Error when a rollout can't be redeployed.

Redeploy can only be used for rollouts that are in a SUCCEEDED or FAILED
state.
c                 P   > SR                  XU5      n[        [        U ]  U5        g )NzPUnable to redeploy target {}. Rollout {} is in state {} that can't be redeployed)r
   r   rU   r   )r   target_namerollout_namerollout_stater&   r   s        r   r   RedeployRolloutError.__init__y   s+    	{-H  

.y9r   r   r   r   s   @r   rU   rU   r   s    : :r   rU   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )RolloutIDExhaustedError   z;Error when there are too many rollouts for a given release.c                 J   > [         [        U ]  SR                  U5      5        g )NzSRollout name space exhausted in release {}. Use --rollout-id to specify rollout ID.)r   r]   r   r
   r.   s     r   r    RolloutIDExhaustedError.__init__   s"    	
!41	$f\2r   r   r   r   s   @r   r]   r]      s    C r   r]   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )RolloutInProgressError   zbError when there is a rollout in progress, no to-target value is given and a promote is attempted.c                 J   > [         [        U ]  SR                  X5      5        g )NzLUnable to promote release {} to target {}. A rollout is already in progress.)r   rb   r   r
   )r   r'   rX   r   s      r   r   RolloutInProgressError.__init__   s"    	
 $0	,,2F<,Mr   r   r   r   s   @r   rb   rb      s    j r   rb   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )RolloutNotInProgressError   z?Error when a rollout is not in_progress, but is expected to be.c                 J   > [         [        U ]  SR                  U5      5        g )NzRollout {} is not IN_PROGRESS.)r   rg   r   r
   )r   rY   r   s     r   r   "RolloutNotInProgressError.__init__   s!    	
#T3(//=r   r   r   r   s   @r   rg   rg      s    G r   rg   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )RolloutCannotAdvanceError   zIError when a rollout cannot be advanced because of a failed precondition.c                 N   > SR                  X!5      n[        [        U ]  U5        g )Nz!{} Rollout {} cannot be advanced.)r
   r   rl   r   )r   rY   failed_activity_msgr&   r   s       r   r   "RolloutCannotAdvanceError.__init__   s(    3::I 

#T3I>r   r   r   r   s   @r   rl   rl      s    Q? ?r   rl   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )PipelineSuspendedError   z?Error when a user performs an activity on a suspended pipeline.c                 N   > SR                  X!5      n[        [        U ]  U5        g )Nz${} DeliveryPipeline {} is suspended.)r
   r   rr   r   )r   pipeline_namero   r&   r   s       r   r   PipelineSuspendedError.__init__   s(    6==I 

 $0;r   r   r   r   s   @r   rr   rr      s    G< <r   rr   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )AutomationNameFormatError   TError when the name of the automation in the config file is not formatted correctly.c                 J   > [         [        U ]  SR                  U5      5        g )Nz]Automation name {} in the configuration should be in the format of pipeline_id/automation_id.)r   rx   r   r
   )r   automation_namer   s     r   r   "AutomationNameFormatError.__init__   s"    	
#T3	))/)@r   r   r   r   s   @r   rx   rx      s    \ r   rx   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )AutomationWaitFormatError   rz   c                 ,   > [         [        U ]  S5        g )Nz8Wait must be numbers with the last character m, e.g. 5m.)r   r   r   r    s    r   r   "AutomationWaitFormatError.__init__   s    	
#T3Br   r   r   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$ ) MissingCoupledArgumentsException   z^An exception for when only one of several arguments that need to be passed together is passed.c                 4   > [         [        U ]  SU S35        g )NzAll of these flags z must be supplied together)r   r   r   )r   parameter_namesr   s     r   r   )MissingCoupledArgumentsException.__init__   s!    	
*D:
o..HIr   r   r   r   s   @r   r   r      s    f r   r   N)r   googlecloudsdk.callioper   c_exceptionsgooglecloudsdk.coreHTTP_ERROR_FORMATErrorr   r   r#   r+   r1   r7   rM   rP   rU   r]   rb   rg   rl   rr   rx   r   ToolExceptionr   r   r   r   <module>r      sP   - ? *C +*"" +":++ @J,, @J$$ j.. LZ-- L C!1!1 C
(( ::++ :j.. Z-- 
 0 0 ?
 0 0 ?<Z-- <
 0 0 
 0 0 |'A'A r   