
    Fg
                         S SK Jr  S SKJ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)    )Optional)DocumentHandlec                   J   ^  \ rS rSrSr  SS\S\S\\   4U 4S jjjr	Sr
U =r$ )	DeepLException
   a5  Base class for deepl module exceptions.

:param message: Message describing the error that occurred.
:param should_retry: True if the request would normally be retried
    following this error, otherwise false.
:param http_status_code: The HTTP status code in the response, if
    applicable, otherwise None.
messageshould_retryhttp_status_codec                 <   > [         TU ]  U5        X l        X0l        g N)super__init__r	   r
   )selfr   r	   r
   	__class__s       a/Users/admin/workspace/ai/PDFMathTranslate/myenv/lib/python3.13/site-packages/deepl/exceptions.pyr   DeepLException.__init__   s     	!( 0    )r
   r	   )FN)__name__
__module____qualname____firstlineno____doc__strboolr   intr   __static_attributes____classcell__r   s   @r   r   r   
   s:     #*.	11 1 #3-	1 1r   r   c                       \ rS rSrSrSrg)AuthorizationException   z4Authorization failed, check your authentication key. Nr   r   r   r   r   r   r"   r   r   r    r       s    >r   r    c                       \ rS rSrSrSrg)QuotaExceededException%   z0Quota for this billing period has been exceeded.r"   Nr#   r"   r   r   r%   r%   %   s    :r   r%   c                       \ rS rSrSrSrg)TooManyRequestsException+   z3The maximum number of failed attempts were reached.r"   Nr#   r"   r   r   r(   r(   +   s    =r   r(   c                   >   ^  \ rS rSrSr SS\S\4U 4S jjjrSrU =r	$ )ConnectionException1   zConnection to the DeepL API failed.

:param message: Message describing the error that occurred.
:param should_retry: True if the request would normally be retried
    following this error, otherwise false.
r   r	   c                 "   > [         TU ]  UUS9  g )N)r	   )r   r   )r   r   r	   r   s      r   r   ConnectionException.__init__9   s    
 	% 	 	
r   r"   )F)
r   r   r   r   r   r   r   r   r   r   r   s   @r   r+   r+   1   s)     #

 
 
r   r+   c                   T   ^  \ rS rSrSrS\S\4U 4S jjrU 4S jr\	S 5       r
SrU =r$ )	DocumentTranslationExceptionD   zError occurred while translating document.

:param message: Message describing the error that occurred.
:param document_handle: The document handle of the associated document.
r   document_handlec                 0   > [         TU ]  U5        X l        g r   )r   r   r2   )r   r   r2   r   s      r   r   %DocumentTranslationException.__init__K   s    !.r   c                 >   > [         TU ]  5        SU R                   3$ )Nz, document handle: )r   __str__r2   )r   r   s    r   r6   $DocumentTranslationException.__str__O   s$    '/#$$78L8L7MNNr   c                 L    SSK nUR                  S[        SS9  U R                  $ )z(Deprecated, use document_handle instead.r   Nzdocument_request is deprecated   )
stacklevel)warningswarnDeprecationWarningr2   )r   r;   s     r   document_request-DocumentTranslationException.document_requestR   s.     	,.@Q 	 	
 ###r   )r2   )r   r   r   r   r   r   r   r   r6   propertyr>   r   r   r   s   @r   r0   r0   D   s5    / /n /O $ $r   r0   c                       \ rS rSrSrSrg)GlossaryNotFoundException]   z%The specified glossary was not found.r"   Nr#   r"   r   r   rB   rB   ]   s    /r   rB   c                       \ rS rSrSrSrg)DocumentNotReadyExceptionc   z>The translation of the specified document is not yet complete.r"   Nr#   r"   r   r   rE   rE   c   s    Hr   rE   N)typingr   deepl.api_datar   	Exceptionr   r    r%   r(   r+   r0   rB   rE   r"   r   r   <module>rJ      sm   
  )1Y 1*	^ 		^ 		~ 	
. 
&$> $2	 		 	r   