diff --git a/docs/source/api.rst b/docs/source/api.rst index 57059f442..7f8570755 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -1112,8 +1112,18 @@ Neo4j Execution Errors .. autoclass:: neo4j.exceptions.Neo4jError - Raised when the Cypher engine returns an error to the client. - There are many possible types of Cypher error, each identified by a unique `status code `_. + .. autoproperty:: message + + .. autoproperty:: code + + There are many Neo4j status codes, see `status code `_. + + .. autoproperty:: classification + + .. autoproperty:: category + + .. autoproperty:: title + .. autoclass:: neo4j.exceptions.ClientError :show-inheritance: diff --git a/neo4j/exceptions.py b/neo4j/exceptions.py index 4a7b05b28..91e7c72d3 100644 --- a/neo4j/exceptions.py +++ b/neo4j/exceptions.py @@ -124,6 +124,9 @@ def _extract_error_class(cls, classification, code): else: return cls + def __str__(self): + return "{{code: {code}}} {{message: {message}}}".format(code=self.code, message=self.message) + class ClientError(Neo4jError): """ The Client sent a bad request - changing the request might yield a successful outcome.