
                         *   S r SSKJr  SSKJ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\
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g)z&Custom errors for SCC IaC Remediation.    )absolute_import)division)print_function)unicode_literals)const)
exceptionsc                       \ rS rSrSrSrg)Error   zBase error for this module. N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       <lib/googlecloudsdk/command_lib/scc/iac_remediation/errors.pyr
   r
      s    #r   r
   c                   4   ^  \ rS rSrSrS\4U 4S jjrSrU =r$ )InvalidFindingNameError   zFAn error respresenting an invalid finding canonical format name error.bad_finding_namec                 b   > Uc  [         [        U ]  S5        g [         [        U ]  SU S35        g )NzMissing finding canonical name.z Invalid finding canonical name: zF
          Correct format: projects/*/sources/*/locations/*/findings/*superr
   __init__)selfr   	__class__s     r   r    InvalidFindingNameError.__init__!   s>    E4!"CDE4!./?.@ AF Ir   r   	r   r   r   r   r   strr   r   __classcell__r   s   @r   r   r      s    Ns  r   r   c                   4   ^  \ rS rSrSrS\4U 4S jjrSrU =r$ )UnsupportedFindingCategoryError+   z<An error representing an unsupported finding category error.invalid_category_namec                 b   > Uc  [         [        U ]  S5        g [         [        U ]  SU S35        g )NzMissing finding category name.z Finding category not supported: .r   )r   r'   r   s     r   r   (UnsupportedFindingCategoryError.__init__.   s6    $E4!"BCE4!,-B,C1
Er   r   r    r#   s   @r   r%   r%   +   s    DC  r   r%   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )FindingNotFoundError7   z4An error representing a SCC finding not found error.c                 ,   > [         [        U ]  S5        g )Nz6Finding not found for the given name and organization.r   r   r   s    r   r   FindingNotFoundError.__init__:   s    	%@r   r   r   r   r   r   r   r   r   r"   r#   s   @r   r,   r,   7       < r   r,   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )GitRepoNotFoundError@   z1An error representing a git repo not found error.c                 ,   > [         [        U ]  S5        g )Nz,Command is being invoked from a non-git repor   r/   s    r   r   GitRepoNotFoundError.__init__C   s    	%6r   r   r1   r#   s   @r   r4   r4   @   s    9 r   r4   c                   4   ^  \ rS rSrSrS\4U 4S jjrSrU =r$ )InvalidGitConfigErrorI   z;An error representing missing field in the git config file.missing_fieldc                 b   > Uc  [         [        U ]  S5        g [         [        U ]  SU S35        g )NzMissing git config field name.z(Field missing from the git config file: r)   r   )r   r;   r   s     r   r   InvalidGitConfigError.__init__L   s4    E4!"BCE4!4]O1
Er   r   r    r#   s   @r   r9   r9   I   s    CC  r   r9   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )EmptyLLMResponseErrorU   4An error representing an invalid LLM response error.c                 ,   > [         [        U ]  S5        g )NzLLM response is empty.r   r/   s    r   r   EmptyLLMResponseError.__init__X   s    	% r   r   r1   r#   s   @r   r?   r?   U   r2   r   r?   c                   4   ^  \ rS rSrSrS\4U 4S jjrSrU =r$ )InvalidLLMResponseError^   rA   error_messagec                 `   > Uc  [         [        U ]  S5        g [         [        U ]  SU 35        g )NzInvalid LLM response.zInvalid LLM response: r   )r   rG   r   s     r   r    InvalidLLMResponseError.__init__a   s0    E4!"9:E4!$:=/"JKr   r   r    r#   s   @r   rE   rE   ^   s    <LC L Lr   rE   c                   4   ^  \ rS rSrSrS\4U 4S jjrSrU =r$ )ExcessiveMembersErrorh   z1An error representing an excessive members error.num_membersc                 V   > [         [        U ]  SU S[        R                   S35        g )Nz"Excessive members in the finding: z, expected atmost r)   )r   r
   r   r    SUPPORTED_IAM_MEMBER_COUNT_LIMIT)r   rM   r   s     r   r   ExcessiveMembersError.__init__k   s1    	%
,[M :2231	6r   r   )	r   r   r   r   r   intr   r   r"   r#   s   @r   rK   rK   h   s    9#  r   rK   N)r   
__future__r   r   r   r   *googlecloudsdk.api_lib.scc.iac_remediationr   googlecloudsdk.corer   r
   r   r%   r,   r4   r9   r?   rE   rK   r   r   r   <module>rU      s    - &  % ' < *$J $
e 
	e 	5 5 	E 	E Le LE r   