
    9?h,                     @   % 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\\\   \\   \\   \\   \\   \\   \\   \\   \\   \\   4
   r\\\\\\\\\\\\4   r0 q\\\4   \S'     S?S\\\\\\\   4   4      S \\   S!\\\\   4   4S" jjr    S@S#\S$\\!   S%\\!   S&\\"   S!\4
S' jjr#S(\$S!\4S) jr%0 S*\_S+\_S,\_S-\_S.\_S/\_S0\_S1\_S2\_S3\_S4\_S5\_S6\_S7\_S8\_S9\_S:\_\\\\\\\\\\\\\\S;.Er&\\!\4   \S<'   \\\\\\\\S=.r'\\\4   \S>'   g)Az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%   z;Exception that is base class for all other error exceptionsN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	           ^/var/www/ev-aguas/ev-aguas-proceso/venv/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__J   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    E "#8<"& @c] @ } @ uS#X345	 @
 3- @ 
 @  @D  r+   r   c                       \ rS rSrSrSrg)WarningN   z Exception for important warningsr   Nr,   r-   r.   r/   r0   r3   r   r+   r&   r6   r6   N   s    *r+   r6   c                       \ rS rSrSrSrg)InterfaceErrorR   z-Exception for errors related to the interfacer   Nr8   r   r+   r&   r:   r:   R       7r+   r:   c                       \ rS rSrSrSrg)DatabaseErrorV   z,Exception for errors related to the databaser   Nr8   r   r+   r&   r>   r>   V   s    6r+   r>   c                       \ rS rSrSrSrg)InternalErrorZ   z-Exception for errors internal database errorsr   Nr8   r   r+   r&   rA   rA   Z   r<   r+   rA   c                       \ rS rSrSrSrg)OperationalError^   z8Exception for errors related to the database's operationr   Nr8   r   r+   r&   rD   rD   ^   s    Br+   rD   c                       \ rS rSrSrSrg)ProgrammingErrorb   z'Exception for errors programming errorsr   Nr8   r   r+   r&   rG   rG   b   s    1r+   rG   c                       \ rS rSrSrSrg)IntegrityErrorf   z3Exception for errors regarding relational integrityr   Nr8   r   r+   r&   rJ   rJ   f       =r+   rJ   c                       \ rS rSrSrSrg)	DataErrorj   z;Exception for errors reporting problems with processed datar   Nr8   r   r+   r&   rN   rN   j   s    Er+   rN   c                       \ rS rSrSrSrg)NotSupportedErrorn   zBException for errors when an unsupported database feature was usedr   Nr8   r   r+   r&   rQ   rQ   n   s    Lr+   rQ   c                       \ rS rSrSrSrg)	PoolErrorr   z3Exception for errors relating to connection poolingr   Nr8   r   r+   r&   rT   rT   r   rL   r+   rT   _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)a  Define custom exceptions for MySQL server errors

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

If error is a MySQL Server error number, then you have to pass also the
exception class.

The error argument can also be a dictionary in which case the key is
the server error number, and value the exception to be raised.

If none of the arguments are given, then custom_error_exception() will
simply return the current set customizations.

To reset the customizations, simply supply an empty dictionary.

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({})

Returns a dictionary.
z<The error argument should be either an integer or dictionaryz!Error number should be an integerNz)Exception should be subclass of Exception)	
isinstancedictrV   r2   
ValueErroritems
issubclass	Exceptionr   )rW   rX   r   
_exceptionr"   s        r&   custom_error_exceptionra      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      )rV   KeyError_ERROR_EXCEPTIONSr6   r>   _SQLSTATE_CLASS_EXCEPTION)r   r   r   rb   s       r&   get_mysql_exceptionrh      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      rd   r   #   utf8r	   )r\   
IndexErrorr:   r   rZ   bytes	bytearraydecoder   UnicodeErrorrh   )ri   r   errmsgr"   r   s        r&   get_exceptionrv     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HYrg   )i  i  i  i  i  i  i  i  rf   )NN)NNF)(r0   typingr   r   r   r   r   r   localesr
   typesr   utilsr   r   r_   r   r6   r:   r>   rA   rD   rG   rJ   rN   rQ   rT   ErrorClassTypes
ErrorTypesrV   r2   __annotations__ra   r1   boolrh   rq   rv   rg   rf   r   r+   r&   <module>r      sb  :  > > %  '&I &R+i +8U 87E 78M 8C} C2} 2>] >F FM M> > 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+   