Skip to content

Commit 07dab7d

Browse files
committed
apply some feedback from reviews
1 parent 8214062 commit 07dab7d

File tree

5 files changed

+39
-29
lines changed

5 files changed

+39
-29
lines changed

modules/ROOT/pages/errors/all-errors.adoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
This page lists the legacy server error codes, also known as Neo4j status codes.
88
These will be replaced by xref:errors/gql-errors.adoc[GQLSTATUS server error codes].
99

10-
Neo4j status codes are returned by the server when the execution of a query fails.
10+
Error codes are returned by the server when the execution of a query fails.
1111
They always have the severity level `ERROR`.
1212
Errors are grouped based on the type of the Neo4j status code:
1313

1414
Client errors::
1515
These errors are caused by the client and are usually related to the request itself.
16-
The Neo4j status code for client errors have the prefix `Neo.ClientError`.
16+
The Neo4j status codes for client errors have the prefix `Neo.ClientError`.
1717

1818
Transient errors::
1919
These errors are detected by the server and are usually related to some kind of database unavailability, such as limits reached, out-of-memory, timeouts, etc.
2020
The error can be temporary, and the request could succeed if retried.
21-
The Neo4j status code for transient errors have the prefix Neo.`TransientError`.
21+
The Neo4j status codes for transient errors have the prefix Neo.`TransientError`.
2222

2323
Database errors::
2424
These errors are caused by the database and are usually related to the database state.
25-
The Neo4j status code for database errors have the prefix `Neo.DatabaseError`.
25+
The Neo4j status codes for database errors have the prefix `Neo.DatabaseError`.
2626

2727
This page contains lists of all Neo4j errors, grouped by type.
2828

@@ -33,7 +33,7 @@ This is a complete list of all client errors Neo4j may return, and what they mea
3333
[options="header", cols="<1m,<1"]
3434
|===
3535

36-
| Neo4j status code
36+
| Neo4j legacy code
3737
| Description
3838

3939
| Neo.ClientError.ChangeDataCapture.InvalidIdentifier
@@ -299,7 +299,7 @@ This is a complete list of all transient errors Neo4j may return, and what they
299299
[options="header", cols="<1m,<1"]
300300
|===
301301

302-
| Neo4j status code
302+
| Neo4j legacy code
303303
| Description
304304

305305
| Neo.TransientError.ChangeDataCapture.FutureIdentifier
@@ -406,7 +406,7 @@ This is a complete list of all database errors Neo4j may return, and what they m
406406
[options="header", cols="<1m,<1"]
407407
|===
408408

409-
| Neo4j status code
409+
| Neo4j legacy code
410410
| Description
411411

412412
| Neo.DatabaseError.ChangeDataCapture.Disabled

modules/ROOT/pages/errors/gql-errors.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ All errors in Neo4j have severity level `ERROR`.
99

1010
== Connection exceptions
1111

12-
Connection exceptions occur when the client is unable to connect to the server for various reasons such as network issues, server-side routing being disabled, or the database being unavailable, etc.
12+
Connection exceptions occur when the client (e.g. Browser/Bloom/Cypher Shell) is unable to connect to the server for various reasons such as network issues, server-side routing being disabled, or the database being unavailable, etc.
1313

1414
=== 08000
1515

modules/ROOT/pages/errors/index.adoc

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
= Server errors
44

55
The Neo4j DBMS returns a server error to indicate that the outcome of a Cypher query or command execution is unsuccessful.
6-
The driver receives these errors and sends them to the client, which displays them to the user.
76

8-
Starting from version 5.25, the Neo4j error codes have an additional GQL-status object that provides information about the status of a Cypher query or command execution in compliance with the link:https://www.iso.org/standard/76120.html[ISO/IEC 39075:2024(en) - Information technology - Database languages - GQL Standard].
7+
Starting from version 5.25, the Neo4j error codes have an additional GQL-status object along with the Neo4j exception that provides information about the status of a Cypher query or command execution in compliance with the link:https://www.iso.org/standard/76120.html[ISO/IEC 39075:2024(en) - Information technology - Database languages - GQL Standard].
98

109
This page describes the GQL-status object and the Neo4j error frameworks, their structure, the objects they provide for errors, and how to interpret them.
1110
It also explains the error internals and the server-driver compatibility for both the GQLSTATUS and legacy errors.
@@ -30,10 +29,11 @@ Each GQL-status object consists of the following fields:
3029
[cols="<1s,<4"]
3130
|===
3231
|GQLSTATUS code
33-
a| A 5-character string that is the concatenation of a 2-character class code followed by a 3-character subclass code.
32+
a| A 5-character string that is the concatenation of a 2-character class code followed by a 3-character subclass code, which identifies the condition of the error.
3433
|StatusDescription
35-
a| A human-readable description of the GQLSTATUS, which consists of a condition, a subcondition, and a description.
34+
a| A human-readable description of the GQLSTATUS, which consists of a condition, a subcondition, and an optional additional text about the condition.
3635
The condition and subcondition are textual representations of the class and subclass codes, respectively.
36+
The subcondition for the subclass 000 is empty.
3737
| DiagnosticRecord
3838
a| Extra information about the status, given as key-value pairs, both on the server and driver side.
3939
To retrieve the full diagnostic record, you can use the `diagnosticRecord()` method on both the server and driver sides.
@@ -44,30 +44,31 @@ Additional helper methods are exposed for some useful fields.
4444
! `OPERATION` ! The operation that the error is related to. Always defaults to empty.
4545
! `OPERATION_CODE` ! The operation code that the error is related to. Always defaults to `0`.
4646
! `CURRENT_SCHEMA` ! The current schema that the error is related to. Always defaults to `/`.
47-
! `_severity` a! The Neo4j severity level of the error, which is always `ERROR`.
47+
//! `_severity` a! The Neo4j severity level of the error, which is always `ERROR`.
4848
!`_classification` ! The Neo4j error classification, which can be `CLIENT_ERROR`, `TRANSIENT_ERROR`, or `DATABASE_ERROR`.
49-
! `_position` ! The position, given by row and column, where the error is relevant in the query text.
49+
! `_position` ! (Optional) The position, given by offset, line and column, where the error is relevant in the query text.
5050
//! `_status_parameters`! A map that contains all variable parts of the status description.
5151
!===
5252
|===
5353

54-
A GQL-status error object can also contain an optional wrapped GQL-status object to provide additional diagnostic information, such as a cause.
54+
A GQL-status error object can also contain an optional wrapped GQL-status object.
55+
This wrapped object is referred to as a `cause` and used to provide additional, more specific diagnostic information.
5556

5657
[[gqlstatus-neo4j-defined-codes]]
5758
== Classes of GQLSTATUS error codes
5859

5960
The Neo4j GQLSTATUS codes are divided into classes and subclasses.
6061
The class code is a 2-character string that indicates the general condition of the status, such as connection exception, data exception, etc.
6162
The subclass code is a 3-character string that provides more detailed information about the condition.
62-
The Neo4j-define subclasses start with N, followed by a 2-digit number.
63+
The Neo4j-define subclasses start with N, followed by a 2-digit number, while the ones that do not start with N are standard-defined subclasses.
6364

6465
The following table lists the GQLSTATUS classes and their meanings:
6566

6667
.GQLSTATUS code classes
6768
[frame="topbot", stripes=odd, grid="cols", cols="<1s,<4"]
6869
|===
6970
|Class
70-
|*Description*
71+
|*Condition*
7172

7273
| 08
7374
| connection exception
@@ -98,7 +99,7 @@ The error object consists of the following fields:
9899
.Neo4j legacy error object
99100
[cols="<1s,<4"]
100101
|===
101-
|Neo4j code
102+
|Neo4j legacy code
102103
a|The Neo4j status code in the form of `Neo.[Type].[SubType].[Name]`.
103104
|Description
104105
a|The description of the specific error.
@@ -110,7 +111,7 @@ a|`ERROR`
110111
a|The category of the error.
111112
Available categories are `CLIENT_ERROR`, `TRANSIENT_ERROR`, and `DATABASE_ERROR`.
112113
|Position
113-
a|The position, given by row and column, where the error is relevant in the query text.
114+
a|(Optional) The position, given by offset, line and column, where the error is relevant in the query text.
114115
|===
115116

116117
For more information, see the xref:errors/all-errors.adoc[List of legacy server error codes].
@@ -157,7 +158,7 @@ Most of these implement the `HasStatus` interface, which means they have a Neo4j
157158

158159
On the server side, an exception contains normal Java constructors and methods like `getMessage()`, `getCause()`, etc., and additionally the `status()` method from the `HasStatus` API, which returns the Neo4j status code.
159160

160-
Starting from 5.25, the exceptions also get new compulsary fields for `gqlStatus` and `statusDescription`, and optional fields for the `diagnosticRecord` and `cause`.
161+
Starting from 5.25, the exceptions also get new compulsary fields for `gqlStatus`, `statusDescription`, `diagnosticRecord`, and an optional field for `cause`.
161162
The cause field is a wrapped underlying Neo4j exception, which in turn has its own GQLSTATUS, statusdescription, diagnostic record and message. +
162163
The `getMessage()` method is kept as Java exceptions inherently have this method.
163164
And a new classification field is added to cover the division of client errors, transient errors and database errors, which today is part of the Neo4j status code.
@@ -166,7 +167,7 @@ Exactly how this looks, depends on the combination of driver and server versions
166167
See <<server-driver-compatibility, Server-driver version compatibility>> for more information.
167168

168169
On the driver side, the Neo4jException is extended with the corresponding methods as on the server side.
169-
The driver receives the failure message and extracts the status code and the error message.
170+
The driver receives the Failure Bolt message and extracts the status code and the error message.
170171
Then, it constructs an error object with the status code, error message, and other relevant information, and sends it to the client.
171172

172173
// Starting from 2025.01, the diagnostic record also contains a `_status_parameters` field, which represens a map that contains all variable parts of the status description, such as labels, database names, Cypher clauses, etc.
@@ -179,11 +180,15 @@ As the clients can have separate driver versions, they may have different error
179180

180181
In Neo4j 5.25, the default JSON template for the query log is updated to include `errorInfo` entry.
181182
This entry contains `GQLSTATUS`, `statusDescription`, `classification`, `position` (if applicable), and `cause` (if applicable) with the same entries.
182-
//The `failureReason` entry is deprecated from 5.26.
183+
The `failureReason` entry is deprecated from 5.26.
183184

184185
[NOTE]
185186
====
186-
The default GQLSTATUS code 50N42 is returned when an exception does not have a GQL object. Starting from Neo4j 5.25, GQL objects are added to exceptions; therefore, you can expect many 50N42 codes. However, it’s important not to rely on this default code, as future Neo4j versions might change it by adding an appropriate GQL object to the exception. Additionally, GQL codes for external procedures are not yet stable.
187+
The default GQLSTATUS code 50N42 is returned when an exception does not have a GQL-status object.
188+
Starting from Neo4j 5.25, we started adding GQL objects to exceptions.
189+
Therefore, you can expect many 50N42 codes during this transition period.
190+
However, it is important not to rely on this default code, as future Neo4j versions might change it by adding an appropriate GQL object to the exception.
191+
Additionally, GQL codes for external procedures are not yet stable.
187192
====
188193

189194
// Starting from Neo4j 2025.01, a new JSON template is available for the query log, which is the default set in server_log.xml.

modules/ROOT/pages/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ For more information, see link:https:https://neo4j.com/docs/cypher-manual/curren
1919
As part of this GQL compliance, Cypher now also includes status codes that a GQL-compliant DBMS returns to indicate the outcome of a request.
2020
For more information on the GQL-status object framework for notifications and errors, see xref:notifications/index.adoc[] and xref:errors/index.adoc[].
2121

22-
This manual details all status codes that a Neo4j DBMS may return, including both GQL-compliant and legacy status codes.
22+
This manual details all status codes that a Neo4j DBMS may return, including both GQL-compliant and legacy Neo4j status codes.
2323

2424
ifndef::backend-pdf[]
2525
License: link:{common-license-page-uri}[Creative Commons 4.0]

modules/ROOT/pages/notifications/index.adoc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
= Server notifications
55

66
After a successful query execution, the Neo4j server sends notifications to provide advice on how to improve the query's quality or give additional information about the query execution.
7-
The driver receives these notifications and sends them to the client, which displays them to the user.
7+
The driver receives these notifications and sends them to the client (e.g. Browser/Bloom/Cypher Shell), which displays them to the user.
88

99
From version 5.23, Neo4j has a new GqlStatusObject API in addition to the existing Notification API (deprecated since 5.26).
1010
The GqlStatusObject API provides information about the status of a Cypher query or command execution in compliance with the link:https://www.iso.org/standard/76120.html[ISO/IEC 39075:2024(en) - Information technology - Database languages - GQL Standard].
@@ -34,14 +34,19 @@ The GQL-status object also includes the Neo4j-specific information, such as the
3434
For more information about notification grouping and filtering, see <<notification-grouping-and-filtering>>.
3535

3636
Each GQL-status object consists of the following fields:
37-
37+
— A GQLSTATUS, which is a character string identifying a condition as defined in Subclause 23.1,
38+
“GQLSTATUS”.
39+
— A status description, which is a character string describing the GQLSTATUS.
40+
— A record with diagnostic information as defined in Subclause 23.2, “Diagnostic records”.
41+
— An optional nested GQL-status object for providing additional diagnostic information, such as a
42+
cause.
3843
.GQLSTATUS notification object
3944
[cols="<1s,<4"]
4045
|===
4146
|GQLSTATUS code
42-
a| A 5-character string that is the concatenation of a 2-character class code followed by a 3-character subclass code.
47+
a| A 5-character string that is the concatenation of a 2-character class code followed by a 3-character subclass code, which identifies the condition of the notification.
4348
|StatusDescription
44-
a| A human-readable description of the GQLSTATUS, which consists of a condition, a subcondition, and a description.
49+
a| A human-readable description of the GQLSTATUS, which consists of a condition, a subcondition, and an optional additional text about the condition.
4550
The condition and subcondition are textual representations of the class and subclass codes, respectively.
4651
| DiagnosticRecord
4752
a| Extra information about the status, given as key-value pairs, both on the server and driver side.
@@ -257,7 +262,7 @@ On the server side, notifications are part of the Result Core API.
257262
A method called `getNotifications()`, which is deprecated since 5.26, returns a list of server-side notification objects.
258263
These notifications are then sent to the driver as success Bolt message metadata.
259264
On the driver side, notifications are part of the ResultSummary API, which has a method called `notifications()` that returns a list of driver-side Notification objects.
260-
The result of the `getCode()` or `code()` methods is known as the Neo4j status code.
265+
The result of the `getCode()` or `code()` methods is known as the legacy Neo4j status code.
261266
Driver-side notification configuration filters notifications by severity and/or category at both the driver and session levels.
262267
For more information, see <<notification-grouping-and-filtering, Server notification grouping and filtering>>.
263268

0 commit comments

Comments
 (0)