
    *hF4                        % S r SSKJrJrJrJrJrJr  SSKJ	r	  SSK
Jr  SSKJr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 " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S \5      r " S! S"\5      r\\\   \\   \\   \\   \\   \\   \\   \\   \\   \\   \\   \\   \\   4   r\\\\\\\\\\\\\\\4   r0 q \\!\4   \"S#'     SES%\\\!\\!\\   4   4      S&\\   S'\\!\\   4   4S( jjr#   SFS)\!S*\\$   S+\\$   S,\\%   S'\4
S- jjr&S.\'S'\4S/ jr(0 S0\_S1\_S2\_S3\_S4\_S5\_S6\_S7\_S8\_S9\_S:\_S;\_S<\_S=\_S>\_S?\_S@\_\\\\\\\\\\\\\\SA.Er)\\$\4   \"SB'   \\\\\\\\SC.r*\\!\4   \"SD'   g$)GzPython exceptions.    )DictMappingOptionalTupleTypeUnion   )get_client_error)
StrOrBytes)
read_bytesread_intc                      ^  \ rS rSrSr    SS\\   S\\   S\\\	\\4   S4      S\\   S	S4
U 4S
 jjjr
S	\4S jrSrU =r$ )Error%   zException that is base class for all other error exceptions.

See [1] for more details.

References:
    [1]: https://dev.mysql.com/doc/connector-python/en/connector-python-api-errors-error.html
Nmsgerrnovalues.sqlstatereturnc                   > [         TU ]  5         Xl        U R                  U l        U=(       d    SU l        X@l        U R                  (       dN  SU R                  s=::  a  S:  a7  O  O4[        U R                  5      U l        Ub   U R                  U-  U l        O OU R                  (       d  S=U l        U l        U R                  (       ae  U R                  S:w  aU  U R                  U R                  S.nU R
                  (       a  SnU R
                  US	'   OS
nUR                  " S0 UD6U l        U R                  U R                  U R
                  4U l	        g ! [         a!  nU R                   SU S3U l         S nANS nAff = f)Ni  i  z (Warning: )zUnknown error)r   r   z{errno} ({state}): {msg}statez{errno}: {msg} )
super__init__r   	_full_msgr   r   r
   	TypeErrorformatargs)	selfr   r   r   r   errfieldsfmt	__class__s	           N/var/www/auris/envauris/lib/python3.13/site-packages/mysql/connector/errors.pyr   Error.__init__.   s)    	[b
 xxTTZZ6$6'

3DH!>#xx&0DH "
 (77DNTX88

b(#zz$((;F}}0"&--w& ZZ1&1DNZZ?	 ! >"&((;se1=DHH>s   E 
F$F  Fc                     U R                   $ N)r   )r!   s    r&   __str__Error.__str__P   s    ~~    )r   r    r   r   r   NNNN)__name__
__module____qualname____firstlineno____doc__r   strintr   r   r   r*   __static_attributes____classcell__r%   s   @r&   r   r   %   s     "#8<"& @c] @ } @ uS#X345	 @
 3- @ 
 @  @D  r,   r   c                       \ rS rSrSrSrg)WarningT   z Exception for important warningsr   Nr.   r/   r0   r1   r2   r5   r   r,   r&   r9   r9   T   s    *r,   r9   c                       \ rS rSrSrSrg)InterfaceErrorX   z-Exception for errors related to the interfacer   Nr;   r   r,   r&   r=   r=   X       7r,   r=   c                       \ rS rSrSrSrg)DatabaseError\   z,Exception for errors related to the databaser   Nr;   r   r,   r&   rA   rA   \   s    6r,   rA   c                       \ rS rSrSrSrg)InternalError`   z-Exception for errors internal database errorsr   Nr;   r   r,   r&   rD   rD   `   r?   r,   rD   c                       \ rS rSrSrSrg)OperationalErrord   z8Exception for errors related to the database's operationr   Nr;   r   r,   r&   rG   rG   d   s    Br,   rG   c                       \ rS rSrSrSrg)ProgrammingErrorh   z'Exception for errors programming errorsr   Nr;   r   r,   r&   rJ   rJ   h   s    1r,   rJ   c                       \ rS rSrSrSrg)IntegrityErrorl   z3Exception for errors regarding relational integrityr   Nr;   r   r,   r&   rM   rM   l       =r,   rM   c                       \ rS rSrSrSrg)	DataErrorp   z;Exception for errors reporting problems with processed datar   Nr;   r   r,   r&   rQ   rQ   p   s    Er,   rQ   c                       \ rS rSrSrSrg)NotSupportedErrort   zBException for errors when an unsupported database feature was usedr   Nr;   r   r,   r&   rT   rT   t   s    Lr,   rT   c                       \ rS rSrSrSrg)	PoolErrorx   z3Exception for errors relating to connection poolingr   Nr;   r   r,   r&   rW   rW   x   rO   r,   rW   c                       \ rS rSrSrSrg)ConnectionTimeoutError|   zc
Exception for errors related to the socket connection timing out while connecting with
the server
r   Nr;   r   r,   r&   rZ   rZ   |   s    r,   rZ   c                      ^  \ rS rSr% SrSr\\S'       SS\\   S\\	   S\\
\\	4      S	\\   S
S4
U 4S jjjrSrU =r$ )ReadTimeoutError   zWException for errors relating to socket timing out while receiving data from the serverz
    The Read Operation timed out. As a consequence the current connection has been closed to avoid
    any unstable behaviour, consider using the reconnect() option and continue with the current
    session's workflow.
    DEFAULT_READ_TIMEOUT_ERROR_MSGNr   r   r   r   r   c                 <   > [         TU ]  U R                  X#U5        g r)   )r   r   r_   r!   r   r   r   r   r%   s        r&   r   ReadTimeoutError.__init__   s     	<<eXVr,   r   r-   )r.   r/   r0   r1   r2   r_   r3   __annotations__r   r4   r   r   r5   r6   r7   s   @r&   r]   r]      s}    a+"C  "#,0"&Wc]W }W sCx)	W
 3-W 
W Wr,   r]   c                      ^  \ rS rSr% SrSr\\S'       SS\\   S\\	   S\\
\\	4      S	\\   S
S4
U 4S jjjrSrU =r$ )WriteTimeoutError   zSException for errors relating to socket timing out while sending data to the serverz
    The Write Operation timed out. As a consequence the current connection has been closed to avoid
    any unstable behaviour, consider using the reconnect() option to continue with the current
    session's workflow.
    DEFAULT_WRITE_TIMEOUT_ERROR_MSGNr   r   r   r   r   c                 <   > [         TU ]  U R                  X#U5        g r)   )r   r   rg   ra   s        r&   r   WriteTimeoutError.__init__   s     	==uhWr,   r   r-   )r.   r/   r0   r1   r2   rg   r3   rc   r   r4   r   r   r5   r6   r7   s   @r&   re   re      s}    ],#S  "#,0"&Xc]X }X sCx)	X
 3-X 
X Xr,   re   _CUSTOM_ERROR_EXCEPTIONSNerror	exceptionr   c                    [        U [        5      (       a  U (       d  0 q[        $ U (       d  U(       d  [        $ [        U [        [        45      (       d  [	        S5      e[        U [        5      (       a  X0n U R                  5        HN  u  p#[        U[        5      (       d  [	        S5      e Ub  [        U[        5      (       d  [        e U[        U'   MP     [        $ ! [         a  n[	        S5      UeSnAff = f)a0  Defines custom exceptions for MySQL server errors.

This function defines custom exceptions for MySQL server errors and
returns the current set customizations.

To reset the customizations, simply supply an empty dictionary.

Args:
    error: Can be a MySQL Server error number or a dictionary in which case the
           key is the server error number and the value is the exception to be raised.
    exception: If `error` is a MySQL Server error number then you have to pass
               also the exception class, otherwise you don't.

Returns:
    dictionary: Current set customizations.

Examples:
    ```
    import mysql.connector
    from mysql.connector import errorcode

    # Server error 1028 should raise a DatabaseError
    mysql.connector.custom_error_exception(
        1028, mysql.connector.DatabaseError)

    # Or using a dictionary:
    mysql.connector.custom_error_exception({
        1028: mysql.connector.DatabaseError,
        1029: mysql.connector.OperationalError,
        })

    # Reset
    mysql.connector.custom_error_exception({})
    ```
z<The error argument should be either an integer or dictionaryz!Error number should be an integerNz)Exception should be subclass of Exception)	
isinstancedictrj   r4   
ValueErroritems
issubclass	Exceptionr   )rk   rl   r   
_exceptionr"   s        r&   custom_error_exceptionru      s    R %u#% ''''ec4[))WXX%""[[]%%%@AA	S!J	)J)J *K +5 ' + $#	  	SHIsR	Ss   -C
C:)C55C:r   r   r   warningc                     [         U    " XUS9$ ! [         a     Of = f [        U    " XUS9$ ! [         a     Of = fU(       d  U(       a  [        X5      $ [	        XS9$  [
        USS    " XUS9$ ! [         a    [	        XUS9s $ f = f)a&  Get the exception matching the MySQL error

This function will return an exception based on the SQLState. The given
message will be passed on in the returned exception.

The exception returned can be customized using the
mysql.connector.custom_error_exception() function.

Returns an Exception
)r   r   r   )r   r   r      )rj   KeyError_ERROR_EXCEPTIONSr9   rA   _SQLSTATE_CLASS_EXCEPTION)r   r   r   rv   s       r&   get_mysql_exceptionr|     s     '.3hWW  'CxPP  5&&22F(!A78
 	
  FHEEFs*    
/ 
<<"A3 3B
	B
packetc                    S=p U S   S:w  a  [        S5      e Sn U SS n [        U S5      u  pU S	   S
:w  a0  [	        U [
        [        45      (       a  U R                  S5      nO7U nO4[        U SS S5      u  pUR                  S5      nU R                  S5      n [        XU5      $ ! [         a  n[        SU S35      s SnA$ SnAff = f! [        [        4 a  n[        SU S35      s SnA$ SnAff = f)zReturns an exception object based on the MySQL error

Returns an exception object based on the MySQL error in the given
packet.

Returns an Error-Object.
N      zPacket is not an error packetz"Failed getting Error information (r      rx   r   #   utf8r	   )rp   
IndexErrorr=   r   rn   bytes	bytearraydecoder   UnicodeErrorr|   )r}   r   errmsgr"   r   s        r&   get_exceptionr   ;  s    EK!9<== 
 &*HK +!9?&5)"455v.)&*a8Fv.H]]6*F uh77'  K B3%qIJJK" % K B3%qIJJKsG   B) AC &C )3C )
C3CCCC8C3-C83C80207080A21222324252627282A2B2C2D2E)333435373C3D3F404244HZXA0KHYr{   )i  i  i  i  i  i  i  i  rz   )NN)NNF)+r2   typingr   r   r   r   r   r   localesr
   typesr   utilsr   r   rs   r   r9   r=   rA   rD   rG   rJ   rM   rQ   rT   rW   rZ   r]   re   ErrorClassTypes
ErrorTypesrj   r4   rc   ru   r3   boolr|   r   r   r{   rz   r   r,   r&   <module>r      s  :  > > %  ',I ,^+i +8U 87E 78M 8C} C2} 2>] >F FM M> >U Wu W&X X& K		O	O	 		 	
& 8: $sO34 9 IM+/@$E#tC/)B$BCCDE@$(@$ S(?++,@$J "#	'F'F	#'F sm'F d^	'F
 'FT 8%  8J  8F 9) 9- 9 	
 9 	
	 9
 	) 9 	) 9 	. 9 	
 9 	
 9 	
 9 	
 9 	
 9 	
 9 	- 9 	
 9  	-! 9" 	-# 9$ 












? 9 4_ 45  F 






	1 4_,- 	r,   