
                         4   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  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j                  e
      Z G d de
      Z G d de
      Z G d de
      Zy)z+Error support for Cloud Debugger libraries.    )absolute_import)division)unicode_literals)
exceptionsc                       e Zd Zy)
DebugErrorN)__name__
__module____qualname__     *lib/googlecloudsdk/api_lib/debug/errors.pyr   r      s    r   r   c                        e Zd Z fdZ xZS )InvalidBreakpointTypeErrorc                 f    t         t        |   dj                  |j	                                      y )Nz"{0} is not a valid breakpoint type)superr   __init__format
capitalize)self	type_name	__class__s     r   r   z#InvalidBreakpointTypeError.__init__    s+    	
$d4,33I4H4H4JKMr   r	   r
   r   r   __classcell__r   s   @r   r   r      s    M Mr   r   c                        e Zd Z fdZ xZS )BreakpointNotFoundErrorc                     t         t        |   dj                  |j	                         dj                  |                   y )Nz{0} ID not found: {1}z, )r   r   r   r   r   join)r   breakpoint_idsr   r   s      r   r   z BreakpointNotFoundError.__init__'   s:    	
!41&&y';';'='+yy'@	BCr   r   r   s   @r   r   r   %   s    C Cr   r   c                   "     e Zd ZdZ fdZ xZS )InvalidLogFormatExceptionz$A log format expression was invalid.c                 ,    t         t        |   |       y N)r   r"   r   r   messager   s     r   r   z"InvalidLogFormatException.__init__0   s    	
#T3G<r   r	   r
   r   __doc__r   r   r   s   @r   r"   r"   -   s    ,= =r   r"   c                   "     e Zd ZdZ fdZ xZS )InvalidLocationExceptionz A location argument was invalid.c                 ,    t         t        |   |       y r$   )r   r*   r   r%   s     r   r   z!InvalidLocationException.__init__7   s    	
"D27;r   r'   r   s   @r   r*   r*   4   s    (< <r   r*   c                   "     e Zd ZdZ fdZ xZS )UnknownHttpErrorz3An unknown error occurred during a remote API call.c                 ,    t         t        |   |       y r$   )r   r-   r   )r   errorr   s     r   r   zUnknownHttpError.__init__>   s    	
D*51r   r'   r   s   @r   r-   r-   ;   s    ;2 2r   r-   c                   "     e Zd ZdZ fdZ xZS )MultipleDebuggeesErrorz-Multiple targets matched the search criteria.c                     |rdj                  |      }nd}t        t        |   dj                  |dj	                  |D cg c]  }|j
                   c}                   y c c}w )Nz matching "{0}" zlMultiple possible targets found{0}.
Use the --target option to select one of the following targets:
    {1}

    )r   r   r1   r   r   name)r   pattern	debuggeespattern_msgdr   s        r   r   zMultipleDebuggeesError.__init__E   sc    %,,W5kk	
 $0	$f	'B	1	'BCEF (Cs    A#r'   r   s   @r   r1   r1   B   s    5	F 	Fr   r1   c                   $     e Zd ZdZd fd	Z xZS )NoMatchErrorz&No object matched the search criteria.c                     |r$t         t        |   dj                  ||             y t         t        |   dj                  |             y )Nz No {0} matched the pattern "{1}"z"No {0} was found for this project.)r   r;   r   r   )r   object_typer6   r   s      r   r   zNoMatchError.__init__T   sF    L$(
,
3
3K
IK L$(
.
5
5k
BDr   r$   r'   r   s   @r   r;   r;   Q   s    .D Dr   r;   c                   $     e Zd ZdZd fd	Z xZS )NoDebuggeeErrorz,No debug target matched the search criteria.c           	          |rdj                  |      }nd}|r;|dj                  dj                  |D cg c]  }|j                   c}            z  }t        t        |   |       y c c}w )Nz1No active debug target matched the pattern "{0}"
z5No active debug targets were found for this project.
zHUse the --target option to select one of the following targets:
    {0}
r4   )r   r   r5   r   r?   r   )r   r6   r7   msgr9   r   s        r   r   zNoDebuggeeError.__init__`   sl    @GGPcDc	  &mmY7YQVVY78!:;c 
/4)#. 8s   A))NNr'   r   s   @r   r?   r?   ]   s    4
/ 
/r   r?   N)r(   
__future__r   r   r   googlecloudsdk.api_lib.utilr   api_exceptionsgooglecloudsdk.coreErrorr   r   r   r"   r*   HttpExceptionr-   r1   r;   r?   r   r   r   <module>rH      s     2 &  ' D *!! M MCj C=
 =<z <2~33Z 2FZ F	D: 	D/j /r   