3.3 · Lesson

Error handling

When working with Neo4j, you may encounter various database errors that need to be handled gracefully in your application. The driver throws exceptions that inherit from Neo4jException for all database-related errors. Exceptions related to the driver and its connection are subclasses of ServiceUnavailableException.

  • ClientException —Raised when the CypherNeo4j's implementation of GQL, the ISO standard query language for graph databases. It is declarative: you describe the pattern to find, and the database decides how to find it. syntax is invalid or a constraint is violated
  • AuthenticationException —Raised when authentication fails
  • ServiceUnavailableException —Raised when the database is not accessible
  • TransientException —Raised for temporary failures that may succeed on retry