
    	                     j   d 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 G d de      Z G d de      Z G d de      Z G d de      Zy )!z>Wrapper for user-visible error exceptions to raise in the CLI.    )absolute_import)division)unicode_literals)
exceptionsc                       e Zd ZdZy)Errorz)Exceptions for Deployment Manager errors.N__name__
__module____qualname____doc__     1lib/googlecloudsdk/api_lib/dataproc/exceptions.pyr   r      s    1r   r   c                       e Zd ZdZy)ArgumentErrorzCommand argument error.Nr	   r   r   r   r   r      s    r   r   c                       e Zd ZdZy)JobErrorzJob encountered an error.Nr	   r   r   r   r   r       s    !r   r   c                       e Zd ZdZy)JobTimeoutErrorzJob timed out.Nr	   r   r   r   r   r   $   s    r   r   c                       e Zd ZdZy)OperationErrorzOperation encountered an error.Nr	   r   r   r   r   r   (   s    'r   r   c                       e Zd ZdZy)OperationTimeoutErrorzOperation timed out.Nr	   r   r   r   r   r   ,   s    r   r   c                       e Zd ZdZy)
ParseErrorzFile parsing error.Nr	   r   r   r   r   r   0   s    r   r   c                       e Zd ZdZy)FileUploadErrorzFile upload error.Nr	   r   r   r   r   r   4   s    r   r   c                       e Zd ZdZy)ObjectReadErrorz Cloud Storage Object read error.Nr	   r   r   r   r    r    8   s    (r   r    c                       e Zd ZdZy)ValidationErrorz+Error while validating YAML against schema.Nr	   r   r   r   r"   r"   <   s    3r   r"   c                       e Zd ZdZy)PersonalAuthErrorz1Error while establishing a personal auth session.Nr	   r   r   r   r$   r$   @   s    9r   r$   c                   "     e Zd ZdZ fdZ xZS )GkeClusterGetErrorz"Error while getting a GKE Cluster.c                 J    t         t        |   dj                  |             y )Nz(Error while getting the GKE Cluster: {0})superr&   __init__format)selfcause	__class__s     r   r)   zGkeClusterGetError.__init__G   s"    	
d,299%@Br   )r
   r   r   r   r)   __classcell__r-   s   @r   r&   r&   D   s    *B Br   r&   c                   (     e Zd ZdZ fdZd Z xZS )&GkeClusterMissingWorkloadIdentityErrorz-GKE Cluster is not Workload Identity enabled.c                 8    t         t        |           || _        y )N)r(   r1   r)   gke_cluster_ref)r+   r3   r-   s     r   r)   z/GkeClusterMissingWorkloadIdentityError.__init__O   s    	
0$@B*Dr   c                 T    dj                  | j                  j                               S )NzGKE Cluster "{0}" does not have Workload Identity enabled. Dataproc on GKE requires the GKE Cluster to have Workload Identity enabled. See https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity)r*   r3   RelativeName)r+   s    r   __str__z.GkeClusterMissingWorkloadIdentityError.__str__S   s(    	S fT!!..012r   )r
   r   r   r   r)   r6   r.   r/   s   @r   r1   r1   L   s    5+2r   r1   N)r   
__future__r   r   r   googlecloudsdk.corer   r   r   r   r   r   r   r   r   r    r"   	Exceptionr$   r&   r1   r   r   r   <module>r:      s    E &  ' *2J 2 E  "u "h (U (N  e )e )4e 4:	 :B B2U 2r   