java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.neo4j.driver.exceptions.Neo4jException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ClientException
,DatabaseException
,DiscoveryException
,MessageIgnoredException
,MinVersionAcquisitionException
,ProtocolException
,ServiceUnavailableException
,SessionExpiredException
,TransientException
This is the base class for Neo4j exceptions.
- Since:
- 1.0
- See Also:
-
Constructor Summary
ConstructorDescriptionNeo4jException
(String message) Creates a new instance.Neo4jException
(String code, String message) Creates a new instance.Neo4jException
(String gqlStatus, String statusDescription, String code, String message, Map<String, Value> diagnosticRecord, Throwable cause) Creates a new instance.Neo4jException
(String code, String message, Throwable cause) Creates a new instance.Neo4jException
(String message, Throwable cause) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the error classification as aGqlStatusErrorClassification
enum value.code()
Access the status code for this exception.Returns the GQL diagnostic record.gqlCause()
Returns the GQL error cause.Returns the GQLSTATUS as defined by the GQL standard.Returns the error classification as aString
value.Returns the GQLSTATUS description.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
Neo4jException
Creates a new instance.- Parameters:
message
- the message
-
Neo4jException
Creates a new instance.- Parameters:
message
- the messagecause
- the cause
-
Neo4jException
Creates a new instance.- Parameters:
code
- the codemessage
- the message
-
Neo4jException
Creates a new instance.- Parameters:
code
- the codemessage
- the messagecause
- the cause
-
Neo4jException
@Preview(name="GQL-error") public Neo4jException(String gqlStatus, String statusDescription, String code, String message, Map<String, Value> diagnosticRecord, Throwable cause) Creates a new instance.- Parameters:
gqlStatus
- the GQLSTATUS as defined by the GQL standardstatusDescription
- the status descriptioncode
- the codemessage
- the messagediagnosticRecord
- the diagnostic recordcause
- the cause- Since:
- 5.26.0
-
-
Method Details
-
code
Access the status code for this exception. The Neo4j manual can provide further details on the available codes and their meanings.- Returns:
- textual code, such as "Neo.ClientError.Procedure.ProcedureNotFound"
-
gqlStatus
Returns the GQLSTATUS as defined by the GQL standard.- Returns:
- the GQLSTATUS value
- Since:
- 5.26.0
-
statusDescription
Returns the GQLSTATUS description.- Returns:
- the GQLSTATUS description
- Since:
- 5.26.0
-
diagnosticRecord
Returns the GQL diagnostic record.- Returns:
- the GQL diagnostic record
- Since:
- 5.26.0
-
classification
Returns the error classification as aGqlStatusErrorClassification
enum value.The enum value is parsed using the
rawClassification()
value.Optional.empty()
is returned if theString
value is missing or is unknown.- Returns:
- an
Optional
error classification as aGqlStatusErrorClassification
enum value - Since:
- 5.26.0
- See Also:
-
rawClassification
Returns the error classification as aString
value.The value is extracted from the
diagnosticRecord()
map using"_classification"
key and is expected to be ofTypeSystem.STRING()
type.Optional.empty()
is returned if the value is missing or is of different type. -
gqlCause
Returns the GQL error cause.- Returns:
- an
Optional
of GQL error cause - Since:
- 5.26.0
-