
    Rǻi	                         d Z ddlm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)z3Internal module for all internal exception classes.    )strerrorc                   "     e Zd ZdZ fdZ xZS )	BoltErrorz(Base class for all Bolt protocol errors.c                 2    t         |   |       || _        y N)super__init__address)selfmessager
   	__class__s      O/opt/lhia/marcimex/agent/venv/lib/python3.12/site-packages/neo4j/_exceptions.pyr	   zBoltError.__init__   s    !    __name__
__module____qualname____doc__r	   __classcell__r   s   @r   r   r      s    2 r   r   c                   <     e Zd ZdZ fdZ fdZed        Z xZS )BoltConnectionErrorzRaised when a connection fails.c                 0    d| }t         |   ||       y )NzConnection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. )r   r	   )r   r   r
   msgr   s       r   r	   zBoltConnectionError.__init__!   s+    7 8?i	A 	 	g&r   c                 j    t         |          }| j                  }|r|d| dt        |       dz  }|S )Nz (code z: ))r   __str__errnor   )r   sr   r   s      r   r   zBoltConnectionError.__str__,   s>    GO

75'HUO#4A66Ar   c                 N    	 | j                   j                  S # t        $ r Y y w xY wr   )	__cause__r   AttributeError)r   s    r   r   zBoltConnectionError.errno3   s)    	>>''' 		s    	$$)	r   r   r   r   r	   r   propertyr   r   r   s   @r   r   r      s$    )	'  r   r   c                   "     e Zd ZdZ fdZ xZS )BoltSecurityErrorz4Raised when a connection fails for security reasons.c                 h    d| j                   j                  j                   dt        |           S )N[z] )r!   r   r   r   r   )r   r   s    r   r   zBoltSecurityError.__str__>   s/    4>>++445R8I7JKKr   )r   r   r   r   r   r   r   s   @r   r%   r%   ;   s    >L Lr   r%   c                   "     e Zd ZdZ fdZ xZS )BoltHandshakeErrorz1Raised when a handshake completes unsuccessfully.c                 B    t         |   ||       || _        || _        y r   )r   r	   request_dataresponse_data)r   r   r
   r+   r,   r   s        r   r	   zBoltHandshakeError.__init__E   s"    '*(*r   r   r   s   @r   r)   r)   B   s    ;+ +r   r)   c                       e Zd ZdZy)BoltProtocolErrorz?Raised when an unexpected or unsupported protocol event occurs.Nr   r   r   r    r   r   r.   r.   K   s    Ir   r.   c                       e Zd ZdZy)SocketDeadlineExceededErrorz9Raised from sockets with deadlines when a timeout occurs.Nr/   r0   r   r   r2   r2   O   s    Cr   r2   N)r   osr   	Exceptionr   r   r%   r)   r.   RuntimeErrorr2   r0   r   r   <module>r6      s\   " : 	 ) :L+ L+ +J	 JD, Dr   