
                         *   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	  G d d	e	j                        Z
 G d
 de
      Z G d de
      Z G d de
      Z G d de
      Z G d de
      Z G d de
      Z G d de
      Z G d de
      Zy)z&Custom errors for SCC IaC Remediation.    )absolute_import)division)print_function)unicode_literals)const)
exceptionsc                       e Zd ZdZy)ErrorzBase error for this module.N)__name__
__module____qualname____doc__     <lib/googlecloudsdk/command_lib/scc/iac_remediation/errors.pyr
   r
      s    #r   r
   c                   (     e Zd ZdZdef fdZ xZS )InvalidFindingNameErrorzFAn error respresenting an invalid finding canonical format name error.bad_finding_namec                 `    |t         t        |   d       y t         t        |   d| d       y )NzMissing finding canonical name.z Invalid finding canonical name: zF
          Correct format: projects/*/sources/*/locations/*/findings/*superr
   __init__)selfr   	__class__s     r   r   z InvalidFindingNameError.__init__!   s>    E4!"CDE4!./?.@ AF Ir   r   r   r   r   strr   __classcell__r   s   @r   r   r      s    Ns  r   r   c                   (     e Zd ZdZdef fdZ xZS )UnsupportedFindingCategoryErrorz<An error representing an unsupported finding category error.invalid_category_namec                 `    |t         t        |   d       y t         t        |   d| d       y )NzMissing finding category name.z Finding category not supported: .r   )r   r!   r   s     r   r   z(UnsupportedFindingCategoryError.__init__.   s6    $E4!"BCE4!,-B,C1
Er   r   r   s   @r   r    r    +   s    DC  r   r    c                   "     e Zd ZdZ fdZ xZS )FindingNotFoundErrorz4An error representing a SCC finding not found error.c                 ,    t         t        |   d       y )Nz6Finding not found for the given name and organization.r   r   r   s    r   r   zFindingNotFoundError.__init__:   s    	%@r   r   r   r   r   r   r   r   s   @r   r%   r%   7       < r   r%   c                   "     e Zd ZdZ fdZ xZS )GitRepoNotFoundErrorz1An error representing a git repo not found error.c                 ,    t         t        |   d       y )Nz,Command is being invoked from a non-git repor   r'   s    r   r   zGitRepoNotFoundError.__init__C   s    	%6r   r(   r   s   @r   r+   r+   @   s    9 r   r+   c                   (     e Zd ZdZdef fdZ xZS )InvalidGitConfigErrorz;An error representing missing field in the git config file.missing_fieldc                 `    |t         t        |   d       y t         t        |   d| d       y )NzMissing git config field name.z(Field missing from the git config file: r#   r   )r   r/   r   s     r   r   zInvalidGitConfigError.__init__L   s4    E4!"BCE4!4]O1
Er   r   r   s   @r   r.   r.   I   s    CC  r   r.   c                   "     e Zd ZdZ fdZ xZS )EmptyLLMResponseError4An error representing an invalid LLM response error.c                 ,    t         t        |   d       y )NzLLM response is empty.r   r'   s    r   r   zEmptyLLMResponseError.__init__X   s    	% r   r(   r   s   @r   r2   r2   U   r)   r   r2   c                   (     e Zd ZdZdef fdZ xZS )InvalidLLMResponseErrorr3   error_messagec                 ^    |t         t        |   d       y t         t        |   d|        y )NzInvalid LLM response.zInvalid LLM response: r   )r   r7   r   s     r   r   z InvalidLLMResponseError.__init__a   s0    E4!"9:E4!$:=/"JKr   r   r   s   @r   r6   r6   ^   s    <LC L Lr   r6   c                   (     e Zd ZdZdef fdZ xZS )ExcessiveMembersErrorz1An error representing an excessive members error.num_membersc                 V    t         t        |   d| dt        j                   d       y )Nz"Excessive members in the finding: z, expected atmost r#   )r   r
   r   r    SUPPORTED_IAM_MEMBER_COUNT_LIMIT)r   r;   r   s     r   r   zExcessiveMembersError.__init__k   s1    	%
,[M :2231	6r   )r   r   r   r   intr   r   r   s   @r   r:   r:   h   s    9#  r   r:   N)r   
__future__r   r   r   r   *googlecloudsdk.api_lib.scc.iac_remediationr   googlecloudsdk.corer   r
   r   r    r%   r+   r.   r2   r6   r:   r   r   r   <module>rB      s    - &  % ' < *$J $
e 
	e 	5 5 	E 	E Le LE r   