Neodriver_core.ErrorsError taxonomy (server and driver errors).
Error taxonomy for the Neo4j driver.
See errors.ml for the implementation.
type server_error = {code : string;message : string;classification : classification;retryable : bool;gql_status : string option;status_description : string option;diagnostic_record : (string * Values.t) list option;gql_classification : string option;raw_classification : string option;cause : server_error option;idempotent : bool;}A server (Neo4j) error as reported over the wire. gql_status is the GQL status code from the FAILURE metadata (Bolt >= 5.2 / 5.7), when the server provides one; with a Bolt 5.7 server it comes with a status_description, the diagnostic_record (its default entries filled in), the parsed gql_classification and raw_classification and an optional nested cause error. idempotent is the Bolt >= 6.0 diagnostic_record._idempotent flag: the server guarantees the failed request did not alter any database state, so an auto-commit RUN failing with such an error may be retried safely.
type t = | Neo4j of server_error| Session_expired of string| Incomplete_commit of string| Session_error of string| Transaction_error of string| Transaction_nesting_error of string| Result_failed_error of string| Result_consumed_error of string| Result_not_single_error of string| Broken_record_error of string| Configuration_error of string| Auth_configuration_error of string| Certificate_configuration_error of string| Unsupported_server_product of string| Connection_pool_error of string| Connection_acquisition_timeout of stringDriver and server errors.
*)All errors from a failed multi-address connection attempt: last is the most recent failure and all lists every failure in order of occurrence. The OCaml analogue of the Python driver's exception aggregation when no resolved address can be connected.
val is_retryable : t -> boolWhether an error is safe to retry a transaction after.
make_retryable error returns error with its retryability forced to true (the OCaml analogue of the Python driver marking a Neo4j error retryable once an auth manager handled it); driver errors are returned unchanged.
val of_neo4j_code : code:string -> message:string -> tBuild a server error from a neo4j code and message, applying the classification and legacy re-write maps.
val of_neo4j_code_with_gql_status :
gql_status:string option ->
code:string ->
message:string ->
tLike of_neo4j_code, but also records the gql_status from the Bolt >= 5.2 FAILURE metadata.
val server_error_of_neo4j_gql :
code:string ->
message:string ->
gql_status:string ->
status_description:string ->
diagnostic_record:(string * Values.t) list option ->
gql_classification:string ->
raw_classification:string option ->
cause:server_error option ->
server_errorBuild a Bolt 5.7 style server error with its GQL status fields, diagnostic record and nested cause.
val idempotent : t -> boolWhether the server marked the failure idempotent (an auto-commit RUN failing with it may be retried); false for driver errors and unmarked server errors.
val status_description : t -> string optionThe GQL status description of a server error, if any.
The diagnostic record of a server error (with its default entries filled in), if any.
val gql_classification : t -> string optionThe parsed GQL classification of a server error ("UNKNOWN" when the server did not provide a known one), if any.
val raw_classification : t -> string optionThe raw _classification string of a server error's diagnostic record, when it is a string.
val cause : t -> server_error optionThe nested server error a failure reported as its cause, if any.
mark_idempotent error returns error with its idempotent marker set (used when the Bolt >= 6 diagnostic_record._idempotent flag is present); driver errors are returned unchanged.
clear_idempotent error returns error without its idempotent marker (used for a failure that answered a TELEMETRY rather than the RUN itself); driver errors are returned unchanged.
val code : t -> string optionThe neo4j code of a server error, or None for driver errors.
val message : t -> stringThe message of an error.
val classification : t -> classification optionThe classification of a server error, or None for driver errors.
val unauthenticates_all_connections : t -> boolWhether the error invalidates the authentication of all connections (AuthorizationExpired).
val has_security_code : t -> boolWhether the error carries a Neo.ClientError.Security.* code.
val is_fatal_during_discovery : t -> boolWhether the error should fail fast during routing discovery.
val to_string : t -> stringRender an error as a human-readable string.
val classification_to_string : classification -> stringRender a classification as its neo4j string ("ClientError", ...).
val specific_to_string : specific -> stringRender a specific error kind as a string.