
    Rǻi	                    Z   U d Z ddlmZ ddlmZ ddlmZ	 ddl
mZ ej                  rNddlmZmZmZmZ ddlmZmZmZmZ eez  ez  ez  Z d	e!d
<   eez  Z"d	e!d<   eez  Z#d	e!d<    ejH                  d      Z%g dZ&dZ'de!d<   dZ(de!d<   dZ)de!d<   e(dfe'dfe'dfdZ*de!d<   dZ+de!d<   dZ,de!d<   d Z-de!d!<   d"Z.de!d#<   e- d$Z/de!d%<   d&Z0d'e!d(<    G d) d*e1e	      Z2 G d+ d,e3      Z4 G d- d.e4      Z5 G d/ d0      Z6 G d1 de5      Z7 G d2 d3e7      Z8 G d4 d5e7      Z9 G d6 d7e7      Z: G d8 d9e7      Z; G d: d;e;      Z< G d< d=e7      Z= G d> de5      Z> G d? de5      Z? G d@ dAe?      Z@ G dB dCe?      ZA G dD dEe?      ZBi dFe:dGe:dHe:dIe:dJe8dKe8dLe9dMe9dNe9dOeBdPe=dQe=dRe=dSe=dTe=dUe;dVe;e<eAdWZCdXe!dY<   dZe@iZDdXe!d[<    G d\ d]e4      ZE G d^ d_eE      ZF G d` daeE      ZG G db dceG      ZH G dd deeE      ZI G df dgeI      ZJ G dh dieI      ZK G dj dkeI      ZL G dl dmeE      ZM G dn doeE      ZN G dp dqeE      ZO G dr dseO      ZP G dt dueO      ZQ G dv dweO      ZR G dx dyeO      ZS G dz d{eE      ZT G d| d}eT      ZU G d~ deT      ZV G d deT      ZW G d deE      ZX G d deX      ZYy)au  
Module containing the core driver exceptions.

Driver API Errors
=================
+ Neo4jError
  + ClientError
    + CypherSyntaxError
    + CypherTypeError
    + ConstraintError
    + AuthError
      + TokenExpired
    + Forbidden
  + DatabaseError
  + TransientError
    + DatabaseUnavailable
    + NotALeader
    + ForbiddenOnReadOnlyDatabase

+ DriverError
  + SessionError
  + TransactionError
    + TransactionNestingError
  + ResultError
    + ResultFailedError
    + ResultConsumedError
    + ResultNotSingleError
  + BrokenRecordError
  + SessionExpired
  + ServiceUnavailable
    + RoutingServiceUnavailable
    + WriteServiceUnavailable
    + ReadServiceUnavailable
    + IncompleteCommit
  + ConfigurationError
    + AuthConfigurationError
    + CertificateConfigurationError
    + UnsupportedServerProduct
  + ConnectionPoolError
    + ConnectionAcquisitionTimeoutError
    )annotations)deepcopy)Enum   )_typing)AsyncManagedTransactionAsyncResultAsyncSessionAsyncTransaction)ManagedTransactionResultSessionTransactionz_t.TypeAlias_TTransaction_TResult	_TSession_T)$AuthConfigurationError	AuthErrorBrokenRecordErrorCertificateConfigurationErrorClientErrorConfigurationError!ConnectionAcquisitionTimeoutErrorConnectionPoolErrorConstraintErrorCypherSyntaxErrorCypherTypeErrorDatabaseErrorDatabaseUnavailableDriverError	ForbiddenForbiddenOnReadOnlyDatabaseGqlErrorGqlErrorClassificationIncompleteCommit
Neo4jError
NotALeaderReadServiceUnavailableResultConsumedErrorResultErrorResultFailedErrorResultNotSingleErrorRoutingServiceUnavailableServiceUnavailableSessionErrorSessionExpiredTokenExpiredTransactionErrorTransactionNestingErrorTransientErrorUnsupportedServerProductWriteServiceUnavailabler   z_t.Final[str]_CLASSIFICATION_CLIENTr5   _CLASSIFICATION_TRANSIENTr   _CLASSIFICATION_DATABASENz&Neo.ClientError.Transaction.Terminatedz-Neo.ClientError.Transaction.LockClientStopped)-Neo.ClientError.Security.AuthorizationExpiredz)Neo.TransientError.Transaction.Terminatedz0Neo.TransientError.Transaction.LockClientStoppedz!dict[str, tuple[str, str | None]]_ERROR_REWRITE_MAPz&Neo.DatabaseError.General.UnknownError_UNKNOWN_NEO4J_CODEzAn unknown error occurred_UNKNOWN_MESSAGE50N42_UNKNOWN_GQL_STATUSz6error: general processing exception - unexpected error_UNKNOWN_GQL_DESCRIPTIONz;: Unexpected error has occurred. See debug log for details._UNKNOWN_GQL_MESSAGE))	OPERATION )OPERATION_CODE0)CURRENT_SCHEMA/z(_t.Final[tuple[tuple[str, _t.Any], ...]]_UNKNOWN_GQL_DIAGNOSTIC_RECORDc                       e Zd ZdZdZdZdZdZy)r%   a  
    Server-side GQL error category.

    Inherits from :class:`str` and :class:`enum.Enum`.
    Hence, can also be compared to its string value::

        >>> GqlErrorClassification.CLIENT_ERROR == "CLIENT_ERROR"
        True
        >>> GqlErrorClassification.DATABASE_ERROR == "DATABASE_ERROR"
        True
        >>> GqlErrorClassification.TRANSIENT_ERROR == "TRANSIENT_ERROR"
        True

    .. seealso:: :attr:`.GqlError.gql_classification`

    .. versionadded:: 5.26

    .. versionchanged:: 6.0 Stabilized from preview.
    CLIENT_ERRORDATABASE_ERRORTRANSIENT_ERRORUNKNOWNN)__name__
__module____qualname____doc__rK   rL   rM   rN        N/opt/lhia/marcimex/agent/venv/lib/python3.12/site-packages/neo4j/exceptions.pyr%   r%      s    ( "L%N'O
 GrT   r%   c                  L    e Zd ZU dZded<   ded<   ded<   ded<   ded	<   d
ed<   d
ed<   ded<   ded<   	 ed!d       Zddd	 	 	 	 	 	 	 	 	 	 	 d"dZd#dZ fdZ	 fdZ
ed$d       Zed$d       Zed$d       Zed%d       Zed&d       Zed'd       Zd(dZd)dZd  Z xZS )*r$   a  
    The GQL compliant data of an error.

    This error isn't raised by the driver as is.
    Instead, only subclasses are raised.
    Further, it is used as the :attr:`__cause__` of GqlError subclasses.

    Sometimes it is helpful or necessary to traverse the cause chain of
    GqlErrors to fully understand or appropriately handle the error. In such
    cases, users can either traverse the :attr:`__cause__` attribute of the
    error(s) or use the helper method :meth:`.find_by_gql_status`. Note that
    :attr:`__cause__` is a standard attribute of all Python
    :class:`BaseException` s: the cause chain may contain other exception types
    besides GqlError.

    .. versionadded: 5.26

    .. versionchanged:: 6.0 Stabilized from preview.
    str_gql_status_message_gql_status_description
str | None_gql_raw_classificationr%   _gql_classificationdict[str, _t.Any]_status_diagnostic_record_diagnostic_recordGqlError | None
_gql_causezBaseException | None	__cause__c                 j   t        |       }|j                  d      }|j                  d      }|j                  d      }|||t        }t        }t        }|j                  d      }|j                  d      }|t        j                  di |}nd }t               }|j                  |||||       |S )N
gql_statusdescriptionmessagediagnostic_recordcausere   rg   rf   rh   ri   rS   )	_MetaExtractor	str_valuer@   rB   rA   	map_valuer$   _hydrate_cause	_init_gql)	metadatameta_extractorre   rf   rg   rh   	cause_mapri   insts	            rU   rn   zGqlError._hydrate_cause   s    '1#--l;
$..}= **95!4,J*G2K*445HI",,W5	 ++8i8EEz!#/ 	 	
 rT   N)rh   ri   c               N    || _         || _        || _        ||| _        || _        y N)rX   rY   rZ   r_   rb   )selfre   rg   rf   rh   ri   s         rU   ro   zGqlError._init_gql  s0     &'2$(->D*rT   c                F    t         | _        t        | _        t        | _        y ru   )r@   rX   rB   rY   rA   rZ   rv   s    rU   _set_gql_unknownzGqlError._set_gql_unknown(  s    .,'?$rT   c                   |dk7  rt         |   |      S | j                  d      }|t         |   |      S | j                  d      }|$|| _        d| _        d | _        t         |   |      S |}t        |       t        |      h}	 t        |dd       }|%||_        d|_        || _        d| _        d | _        |S |}t        |      |v r|S |j                  t        |             `)Nrc   rb   T)	super__getattribute___get_attr_or_nonerc   __suppress_context__rb   idgetattradd)rv   item	gql_causelocal_causerootseen_errorsri   	__class__s          rU   r|   zGqlError.__getattribute__-  s   ;7+D11**<8	7+D11,,[9 'DN(,D%"DO7+D11 $xD*D+t4E}!,,0)!*,0)"&  D$x;& #"OOBtH% rT   c                B    	 t         |   |      S # t        $ r Y y w xY wru   )r{   r|   AttributeError)rv   r   r   s     rU   r}   zGqlError._get_attr_or_noneP  s*    	7+D11 		s    	c                j    t        | d      r| j                  S | j                          | j                  S )a  
        The GQLSTATUS returned from the server.

        The status code ``50N42`` (unknown error) is a special code that the
        driver will use for polyfilling (when connected to an old,
        non-GQL-aware server).
        Further, it may be used by servers during the transition-phase to
        GQLSTATUS-awareness.

        .. note::
            This means that the code ``50N42`` is not guaranteed to be stable
            and may change in future versions of the driver or the server.
        rX   )hasattrrX   ry   rx   s    rU   re   zGqlError.gql_statusV  s2     4'###rT   c                j    t        | d      r| j                  S | j                          | j                  S )a_  
        The error message returned by the server.

        It is a string representation of the error that occurred.

        This message is meant for human consumption and debugging purposes.
        Don't rely on it in a programmatic way.

        This value is never :data:`None` unless the subclass in question
        states otherwise.
        rY   )r   rY   ry   rx   s    rU   rg   zGqlError.messagej  s.     4$== }}rT   c                j    t        | d      r| j                  S | j                          | j                  S )a  
        A description of the GQLSTATUS returned from the server.

        It describes the error that occurred in detail.

        This description is meant for human consumption and debugging purposes.
        Don't rely on it in a programmatic way.
        rZ   )r   rZ   ry   rx   s    rU   gql_status_descriptionzGqlError.gql_status_description|  s3     423///+++rT   c                    t        | d      r| j                  S | j                         }|j                  d      }t	        |t
              sd| _        | j                  S || _        | j                  S )z
        Vendor specific classification of the error.

        This is a convenience accessor for ``_classification`` in the
        diagnostic record. :data:`None` is returned if the classification is
        not available or not a string.
        r\   _classificationN)r   r\   _get_status_diagnostic_recordget
isinstancerW   )rv   diag_recordclassifications      rU   gql_raw_classificationzGqlError.gql_raw_classification  sn     423///88:$):;.#.+/D( +++ ,:D(+++rT   c                X   t        | d      r| j                  S | j                  }t        |t              r:|t        j                  t
        j                  t           t        t                    v s!t        j                  | _        | j                  S t        |      | _        | j                  S )z1The stable GqlErrorClassification for this error.r]   )r   r]   r   r   rW   _tcastIterableiterr%   rN   )rv   r   s     rU   gql_classificationzGqlError.gql_classification  s     4./+++44~s+wwr{{3'.D)EFG (>'E'ED$ ''' (>n'MD$'''rT   c                    t        | d      r| j                  S t        | j                               | _        | j                  S )z%The diagnostic record for this error.r`   )r   r`   	_deepcopyr   rx   s    rU   rh   zGqlError.diagnostic_record  sB     4-.***"+..0#
 &&&rT   c                r    t        | d      r| j                  S t        t              | _        | j                  S )Nr_   )r   r_   dictrI   rx   s    rU   r   z&GqlError._get_status_diagnostic_record  s3    445111)-.L)M&---rT   c                    | j                   |k(  r| S | j                  }|1t        |t              r|j                   |k(  r|S t	        |dd      }|1y)a]  
        Return the first GqlError in the cause chain with the given GQL status.

        This method traverses this GQLErorrs's :attr:`__cause__` chain,
        starting with this error itself, and returns the first error that has
        the given GQL status. If no error matches, :data:`None` is returned.

        Example::

            def invalid_syntax(err: GqlError) -> bool:
                return err.find_by_gql_status("42001") is not None

        :param status: The GQL status to search for.

        :returns: The first matching error or :data:`None`.

        .. versionadded:: 6.0
        Nrc   )re   rc   r   r$   r   )rv   statusri   s      rU   find_by_gql_statuszGqlError.find_by_gql_status  s[    & ??f$K%*u/?/?6/IE;5E 
 rT   c                    d| j                    d| j                   d| j                   d| j                   d| j                   dS )Nz{gql_status: } {gql_status_description: } {message: z} {diagnostic_record: z} {raw_classification: })re   r   rg   rh   r   rx   s    rU   __str__zGqlError.__str__  s]    T__- .))-)D)D(E F,, ($$($:$:#; <%%)%@%@$A	E	
rT   )rp   _t.Anyreturnr$   )re   rW   rg   rW   rf   rW   rh   dict[str, _t.Any] | Noneri   ra   r   None)r   r   r   rW   )r   r[   )r   r%   )r   z_t.Mapping[str, _t.Any]r   r^   )r   rW   r   ra   )rO   rP   rQ   rR   __annotations__staticmethodrn   ro   ry   r|   r}   propertyre   rg   r   r   r   rh   r   r   r   __classcell__r   s   @rU   r$   r$      s9   ( M  ''//00))##  > 7;!%    	 
   4    
  @
!&F    &  " , , , ,& ( ( ' '.<
rT   r$   c                  4   e Zd ZU dZded<   ded<   ded<   ded<   ded<   d	ed
<   dZddZedd       Zedd       Z	edd       Z
ed d       Zed!d       Zed!d       Zed!d       Zed!d       Zed!d       Zed"d       Zd#dZd#dZd#dZd#dZd Zy)$r'   z=Raised when the Cypher engine returns an error to the client.rW   _neo4j_coder   	_category_titler^   	_metadatabool_from_serverFc                    t        j                  | g|  d| _        t        | _        t
        | _        | j                  j                  d      \  }| _        | _	        | _
        y )NF.)	Exception__init__r   r=   r   r>   rY   splitr   r   r   )rv   args_s      rU   r   zNeo4jError.__init__  sT    4'$'!.(""3' 	=4rT   c                    t        |       }|j                  d      xs t        }|j                  d      xs t        }t        j                  ||      }|j                  t        |t         d|        |j                         |_
        |S )Ncoderg   
neo4j_coderg   . re   rg   rf   )rk   rl   r=   r>   r'   _basic_hydratero   r@   rA   restr   )rp   rq   r   rg   rs   s        rU   _hydrate_neo4jzNeo4jError._hydrate_neo4j  s    '1''/F3F **95I9I(( ) 
 	*34Bwi@ 	 	

 (,,.rT   c                    t        |       }|j                  d      }|j                  d      }|j                  d      }|||t        }t        }t        }|j                  dt
              }|j                  d      }|j                  d      }|t        j                  d	i |}nd }t        j                  ||      }	|	j                  |||||       |j                         |	_        |	S )
Nre   rf   rg   r   rh   ri   r   rj   rS   )rk   rl   r@   r>   rA   r=   rm   r'   rn   r   ro   r   r   )
rp   rq   re   status_descriptionrg   r   rh   rr   ri   rs   s
             rU   _hydrate_gqlzNeo4jError._hydrate_gql  s	   '1#--l;
+55mD **95!3!;w,J&G!9#--

 +445HI",,W5	 --:	:EE((! ) 
 	!*/ 	 	
 (,,.rT   c                x   	 | j                  d      \  }}}}t        j                  | d      \  }}||}||} 	 t
        j                  ||       }t        |t              sJ t        j                  |      }	d|	_
        | |	_        ||	_        ||	_        ||	_        ||	_        |	S # t        $ r t        }d}d}Y ~w xY w)Nr   )NNGeneralUnknownErrorT)r   r<   r   
ValueErrorr:   r'   _extract_error_class
issubclassr   __new__r   r   r   r   r   rY   )
r   rg   r   r   categorytitleclassification_overridecode_overrideerror_classrs   s
             rU   r   zNeo4jError._basic_hydrate5  s    	+1;1A1A#1F.A~x 6H5K5KL62#] '2!8(*
(2(G(GJ)
 +y111  - %-!5  	#5N H"E	#s   B# #B98B9c                    | t         k(  r
	 t        |   S | t        k(  r
	 t
        |   S | t        k(  rt        S t        S # t        $ r	 t        cY S w xY w# t        $ r	 t        cY S w xY wru   )
r8   _client_errorsKeyErrorr   r9   _transient_errorsr5   r:   r   r'   )r   r   s     rU   r   zNeo4jError._extract_error_classU  s|    33#%d++ 88&(.. 77     #""#  &%%&s    < A AAA#"A#c                    | j                   S )z)The error message returned by the server.)rY   rx   s    rU   rg   zNeo4jError.messagei  s     }}rT   c                    | j                   S )z
        The neo4j error code returned by the server.

        For example, "Neo.ClientError.Security.AuthorizationExpired".
        r   rx   s    rU   r   zNeo4jError.coden  s     rT   c                    | j                   S ru   )r   rx   s    rU   r   zNeo4jError.classificationw  s     ###rT   c                    | j                   S ru   )r   rx   s    rU   r   zNeo4jError.category|       ~~rT   c                    | j                   S ru   )r   rx   s    rU   r   zNeo4jError.title  s     {{rT   c                    | j                   S ru   r   rx   s    rU   rp   zNeo4jError.metadata  r   rT   c                    | j                   S )E  
        Whether the error is retryable.

        Indicates whether a transaction that yielded this error makes sense to
        retry. This method makes mostly sense when implementing a custom
        retry policy in conjunction with :ref:`explicit-transactions-ref`.

        .. warning::

            Auto-commit transactions
            (:meth:`.Session.run`/:meth:`.AsyncSession.run`) are not retryable
            regardless of this value.

        :returns: :data:`True` if the error is retryable,
            :data:`False` otherwise.

        .. versionadded:: 5.0
        )
_retryablerx   s    rU   is_retryablezNeo4jError.is_retryable  s    & rT   c                     | j                   dk(  S )Nr;   r   rx   s    rU    _unauthenticates_all_connectionsz+Neo4jError._unauthenticates_all_connections  s     OO	
rT   c                v    | j                   }t        |t              sy|dv ry|j                  d      xr |dk7  S )NF>   Neo.ClientError.Request.Invalid'Neo.ClientError.Statement.ArgumentError)Neo.ClientError.Database.DatabaseNotFound+Neo.ClientError.Transaction.InvalidBookmark2Neo.ClientError.Transaction.InvalidBookmarkMixture#Neo.ClientError.Statement.TypeErrorTNeo.ClientError.Security.r;   )r   r   rW   
startswith)rv   r   s     rU   _is_fatal_during_discoveryz%Neo4jError._is_fatal_during_discovery  sO     $$ 
 
 OO78 HGG	
rT   c                R    | j                   y| j                   j                  d      S )NFr   )r   r   rx   s    rU   _has_security_codezNeo4jError._has_security_code  s)    #**+FGGrT   c           	         t        | dd      st        j                  |       S | j                  }| j                  }| j
                  }| j                  }d| d| d| d| d	S )Nr   Fz{neo4j_code: r   z} {gql_status: r   r   )r   r   r   r   rY   rX   rZ   )rv   r   rg   re   gql_descriptions        rU   r   zNeo4jError.__str__  s{    t^U3$$T**--%%
66TF #! #'L )))8(9=	
rT   Nr   objectr   r   )rp   r   r   r'   )r   rW   rg   rW   r   r'   )r   ztype[Neo4jError]r   r   r   r   )rO   rP   rQ   rR   r   r   r   r   r   r   r   r   r   rg   r   r   r   r   rp   r   r   r   r   r   rS   rT   rU   r'   r'     s   GNK  J
    " "H  >  &       $ $      *


(H

rT   r'   c                      e Zd Zd
dZddZej                  dd       Zej                  dd       Z	 d	 	 	 	 	 ddZej                  dd       Zej                  dd       Z	 d	 	 	 	 	 dd	Zy)rk   c                    || _         y ru   r   )rv   rp   s     rU   r   z_MetaExtractor.__init__  s	    !rT   c                    | j                   S ru   r   rx   s    rU   r   z_MetaExtractor.rest  s    ~~rT   c                     y ru   rS   rv   keys     rU   rl   z_MetaExtractor.str_value  s    14rT   c                     y ru   rS   rv   r  defaults      rU   rl   z_MetaExtractor.str_value  s    <?rT   Nc                b    | j                   j                  ||      }t        |t              s|}|S ru   )r   popr   rW   rv   r  r  ress       rU   rl   z_MetaExtractor.str_value  s.     nn  g.#s#C
rT   c                     y ru   rS   r  s     rU   rm   z_MetaExtractor.map_value  s    ?BrT   c                     y ru   rS   r  s      rU   rm   z_MetaExtractor.map_value  s    JMrT   c                    | j                   j                  ||      }t        |t              rt	        d |D              s|}|S )Nc              3  <   K   | ]  }t        |t                y wru   )r   rW   ).0ks     rU   	<genexpr>z+_MetaExtractor.map_value.<locals>.<genexpr>  s     )J*Q*<)Js   )r   r  r   r   allr	  s       rU   rm   z_MetaExtractor.map_value  s;     nn  g.sD!c)Jc)J&JC
rT   )rp   r^   r   r   r   )r  rW   r   r[   )r  rW   r  r   r   zstr | _Tru   )r  rW   r  	_T | Noner   zstr | _T | None)r  rW   r   r   )r  rW   r  r   r   zdict[str, _t.Any] | _T)r  rW   r  r  r   zdict[str, _t.Any] | _T | None)	rO   rP   rQ   r   r   r   overloadrl   rm   rS   rT   rU   rk   rk     s    " [[4 4[[? ? .2!*	 [[B B[[M M .2!*	&rT   rk   c                      e Zd ZdZy)r   z}
    Bad client request.

    The Client sent a bad request - changing the request might yield a
    successful outcome.
    NrO   rP   rQ   rR   rS   rT   rU   r   r         rT   c                      e Zd Zy)r   NrO   rP   rQ   rS   rT   rU   r   r         rT   r   c                      e Zd Zy)r   Nr  rS   rT   rU   r   r     r  rT   r   c                      e Zd Zy)r   Nr  rS   rT   rU   r   r   	  r  rT   r   c                      e Zd ZdZy)r   z*Raised when authentication failure occurs.Nr  rS   rT   rU   r   r         4rT   r   c                      e Zd ZdZy)r2   z1Raised when the authentication token has expired.Nr  rS   rT   rU   r2   r2     s    ;rT   r2   c                      e Zd Zy)r"   Nr  rS   rT   rU   r"   r"     r  rT   r"   c                      e Zd ZdZy)r   z+The database failed to service the request.Nr  rS   rT   rU   r   r     s    5rT   c                      e Zd ZdZdZy)r5   z
    Transient Error.

    The database cannot service the request right now, retrying later might
    yield a successful outcome.
    TN)rO   rP   rQ   rR   r   rS   rT   rU   r5   r5   "  s     JrT   c                      e Zd Zy)r    Nr  rS   rT   rU   r    r    .  r  rT   r    c                      e Zd Zy)r(   Nr  rS   rT   rU   r(   r(   3  r  rT   r(   c                      e Zd Zy)r#   Nr  rS   rT   rU   r#   r#   8  r  rT   r#   z1Neo.ClientError.Schema.ConstraintValidationFailedz*Neo.ClientError.Schema.ConstraintViolationz6Neo.ClientError.Statement.ConstraintVerificationFailedz-Neo.ClientError.Statement.ConstraintViolationz'Neo.ClientError.Statement.InvalidSyntaxz%Neo.ClientError.Statement.SyntaxErrorz#Neo.ClientError.Procedure.TypeErrorz%Neo.ClientError.Statement.InvalidTyper   z3Neo.ClientError.General.ForbiddenOnReadOnlyDatabasez Neo.ClientError.General.ReadOnlyz1Neo.ClientError.Schema.ForbiddenOnConstraintIndexz/Neo.ClientError.Schema.IndexBelongsToConstraintz"Neo.ClientError.Security.Forbiddenz9Neo.ClientError.Transaction.ForbiddenDueToTransactionTypez,Neo.ClientError.Security.AuthorizationFailedz%Neo.ClientError.Security.Unauthorized)z%Neo.ClientError.Security.TokenExpiredz"Neo.ClientError.Cluster.NotALeaderzdict[str, type[Neo4jError]]r   z.Neo.TransientError.General.DatabaseUnavailabler   c                      e Zd ZdZddZd Zy)r!   z'Raised when the Driver raises an error.c                     y)r   FrS   rx   s    rU   r   zDriverError.is_retryablec  s    & rT   c                ,    t         j                  |       S ru   )r   r   rx   s    rU   r   zDriverError.__str__x  s      &&rT   Nr   )rO   rP   rQ   rR   r   r   rS   rT   rU   r!   r!   `  s    1*'rT   r!   c                  0     e Zd ZU dZded<   d fdZ xZS )r0   z2Raised when an error occurs while using a session.r   sessionc                ,    t        |   |  || _        y ru   )r{   r   r*  )rv   session_r   r   s      rU   r   zSessionError.__init__  s    $rT   r   rO   rP   rQ   rR   r   r   r   r   s   @rU   r0   r0   }  s    <   rT   r0   c                  0     e Zd ZU dZded<   d fdZ xZS )r3   z6Raised when an error occurs while using a transaction.r   transactionc                ,    t        |   |  || _        y ru   )r{   r   r/  )rv   transaction_r   r   s      rU   r   zTransactionError.__init__  s    $'rT   r   r-  r   s   @rU   r3   r3     s    @( (rT   r3   c                      e Zd ZdZy)r4   z0Raised when transactions are nested incorrectly.Nr  rS   rT   rU   r4   r4     s    :rT   r4   c                  0     e Zd ZU dZded<   d fdZ xZS )r+   z8Raised when an error occurs while using a result object.r   resultc                ,    t        |   |  || _        y ru   )r{   r   r4  )rv   result_r   r   s      rU   r   zResultError.__init__  s    $rT   r   r-  r   s   @rU   r+   r+     s    B rT   r+   c                      e Zd ZdZy)r,   a1  
    Raised when trying to access records of a failed result.

    A :class:`.Result` will be considered failed if
     * itself encountered an error while fetching records
     * another result within the same transaction encountered an error while
       fetching records

    .. versionadded: 5.14
    Nr  rS   rT   rU   r,   r,     s    	rT   r,   c                      e Zd ZdZy)r*   z:Raised when trying to access records of a consumed result.Nr  rS   rT   rU   r*   r*     s    DrT   r*   c                      e Zd ZdZy)r-   zARaised when a result should have exactly one record but does not.Nr  rS   rT   rU   r-   r-         KrT   r-   c                      e Zd ZdZy)r   z
    Raised when accessing a Record's field that couldn't be decoded.

    This can for instance happen when the server sends a zoned datetime with a
    zone id unknown to the client.
    Nr  rS   rT   rU   r   r     r  rT   r   c                  ,     e Zd ZdZd fdZddZ xZS )r1   z
    The session has expired.

    Raised when a session is no longer able to fulfil the purpose described by
    its original parameters.
    c                    t        |   |  d}d}t        |      dkD  rt        |d   t              r|d   }| d| }| j                  d||       y NrD   zerror: connection exceptionr   r   08000r   r{   r   lenr   rW   ro   rv   r   rg   rf   r   s       rU   r   zSessionExpired.__init__  e    $3t9q=ZQ51gG(MG95K# 	 	
rT   c                     yNTrS   rx   s    rU   r   zSessionExpired.is_retryable      rT   r   r   rO   rP   rQ   rR   r   r   r   r   s   @rU   r1   r1         
rT   r1   c                  ,     e Zd ZdZd fdZddZ xZS )r/   z
    Raised when no database service is available.

    This may be due to incorrect configuration or could indicate a runtime
    failure of a database service that the driver is unable to route around.
    c                    t        |   |  d}d}t        |      dkD  rt        |d   t              r|d   }| d| }| j                  d||       y r>  r@  rB  s       rU   r   zServiceUnavailable.__init__  rC  rT   c                     yrE  rS   rx   s    rU   r   zServiceUnavailable.is_retryable  rF  rT   r   r   rG  r   s   @rU   r/   r/     rH  rT   r/   c                      e Zd ZdZy)r.   z,Raised when no routing service is available.Nr  rS   rT   rU   r.   r.     s    6rT   r.   c                      e Zd ZdZy)r7   z*Raised when no write service is available.Nr  rS   rT   rU   r7   r7     r  rT   r7   c                      e Zd ZdZy)r)   z)Raised when no read service is available.Nr  rS   rT   rU   r)   r)     s    3rT   r)   c                  ,     e Zd ZdZd fdZddZ xZS )r&   aG  
    Raised when the client looses connection while committing a transaction.

    Raised when a disconnection occurs while still waiting for a commit
    response. For non-idempotent write transactions, this leaves the data
    in an unknown state with regard to whether the transaction completed
    successfully or not.
    c                    t        |   |  d}t        |      dkD  rt        |d   t              r|d   }| j                  d|d       y )NrD   r   08007z<error: connection exception - transaction resolution unknownr   r@  )rv   r   rg   r   s      rU   r   zIncompleteCommit.__init__  sP    $t9q=ZQ51gGN	 	 	
rT   c                     y)NFrS   rx   s    rU   r   zIncompleteCommit.is_retryable  s    rT   r   r   rG  r   s   @rU   r&   r&     s    
rT   r&   c                      e Zd ZdZy)r   z9Raised when there is an error concerning a configuration.Nr  rS   rT   rU   r   r   $  s    CrT   r   c                      e Zd ZdZy)r   zDRaised when there is an error with the authentication configuration.Nr  rS   rT   rU   r   r   )  s    NrT   r   c                      e Zd ZdZy)r   zARaised when there is an error with the certificate configuration.Nr  rS   rT   rU   r   r   .  r:  rT   r   c                  $     e Zd ZdZd fdZ xZS )r6   z
    Raised when an unsupported server product is detected.

    .. versionchanged:: 6.0
        This exception is now a subclass of :class:`ConfigurationError`.
        Before it was a subclass of :class:`Exception`.
    c                    t        |   |  y ru   )r{   r   )rv   r   r   s     rU   r   z!UnsupportedServerProduct.__init__<  s    $rT   r   )rO   rP   rQ   rR   r   r   r   s   @rU   r6   r6   3  s       rT   r6   c                      e Zd ZdZy)r   z4Raised when the connection pool encounters an error.Nr  rS   rT   rU   r   r   A  s    >rT   r   c                      e Zd ZdZy)r   z
    Raised when no connection became available in time.

    The amount of time is determined by the connection acquisition timeout
    configuration option.
    Nr  rS   rT   rU   r   r   F  r  rT   r   )ZrR   
__future__r   r   copyr   r   enumr   _EnumrD   r   r   TYPE_CHECKING_async.workr   _AsyncManagedTransactionr	   _AsyncResultr
   _AsyncSessionr   _AsyncTransaction
_sync.workr   _ManagedTransactionr   _Resultr   _Sessionr   _Transactionr   r   r   r   TypeVarr   __all__r8   r9   r:   r<   r=   r>   r@   rA   rB   rI   rW   r%   r   r$   r'   rk   r   r   r   r   r   r2   r"   r   r5   r    r(   r#   r   r   r!   r0   r3   r4   r+   r,   r*   r-   r   r1   r/   r.   r7   r)   r&   r   r   r   r6   r   r   rS   rT   rU   <module>rk     s1  *(T ( &      	!
	
	 	 <  *G3Hl3+h6I|6	D	B%P )6  5+; = ;*9 - 9 	"6 	02 	79#9 5 0 &N ] M"= - =%, ] ,< -   @ @ m L  H S% >O
y O
fb
 b
J# #N* 	 	
	k 	
	k 	
5 5
<9 <
	 	
6J 6
Z 	. 	
	 	
	. 	/7/ 1// =o	/
 4_/ ./@/ ,->/ *?/ ,_/ *?/ :;V/ '	/  8!/" 6y#/$ ))%/& @'/* 3I+/, ,Y-/0 .:*45/+ > 56I2 . '( ': ;  ({ (;. ;
+ 
 
E+ E
L; L
 [ 4 47 2 7
50 5
4/ 4
) 8D D
O/ O
L$6 L

 1 
 ?+ ?
(; rT   