From ba6f2840c20f1c02df5544f5c8aa83564830b701 Mon Sep 17 00:00:00 2001 From: Max Gustafsson <61233757+MaxAake@users.noreply.github.com> Date: Tue, 15 Jul 2025 13:39:07 +0200 Subject: [PATCH] Fix undocumented members on GQLErrors and Neo4jErrors (#1300) --- packages/core/esdoc.json | 2 +- packages/core/src/error.ts | 26 ++++++++++++++++++++ packages/neo4j-driver-deno/lib/core/error.ts | 26 ++++++++++++++++++++ packages/neo4j-driver-lite/esdoc.json | 2 +- packages/neo4j-driver/esdoc.json | 2 +- 5 files changed, 55 insertions(+), 3 deletions(-) diff --git a/packages/core/esdoc.json b/packages/core/esdoc.json index e1366ea31..cc2ae41d2 100644 --- a/packages/core/esdoc.json +++ b/packages/core/esdoc.json @@ -36,7 +36,7 @@ "enable": true }, "brand": { - "title": "Neo4j Bolt Driver 4.1 for JavaScript", + "title": "Neo4j Bolt Driver 6.x for JavaScript", "repository": "https://github.com/neo4j/neo4j-javascript-driver" } } diff --git a/packages/core/src/error.ts b/packages/core/src/error.ts index 40386ddf8..f11dee0f0 100644 --- a/packages/core/src/error.ts +++ b/packages/core/src/error.ts @@ -147,6 +147,13 @@ class GQLError extends Error { * @public */ this.rawClassification = diagnosticRecord?._classification ?? undefined + /** + * Represents the name for the type of error, inherited from base JavaScript {@link Error}. + * Will be 'GQLError' for {@link GQLError}s and 'Neo4jError' for {@link Neo4jError}s. + * + * @type {string} + * @public + */ this.name = 'GQLError' } @@ -171,6 +178,11 @@ class Neo4jError extends GQLError { * Optional error code. Will be populated when error originates in the database. */ code: string + + /** + * Whether the request that caused this error can be safely retried without duplicate commits on the server. + * This does not apply when running auto-commit transactions using {@link Session#run} + */ retriable: boolean /** @@ -195,7 +207,21 @@ class Neo4jError extends GQLError { */ this.code = code + /** + * The name of the type of error. + * + * @type {string} + * @public + */ this.name = 'Neo4jError' + + /** + * If the error is considered retriable. + * This does not apply when running auto-commit transactions using {@link Session#run} + * + * @type {boolean} + * @public + */ this.retriable = _isRetriableCode(code) } diff --git a/packages/neo4j-driver-deno/lib/core/error.ts b/packages/neo4j-driver-deno/lib/core/error.ts index b00bb92dc..01c562352 100644 --- a/packages/neo4j-driver-deno/lib/core/error.ts +++ b/packages/neo4j-driver-deno/lib/core/error.ts @@ -147,6 +147,13 @@ class GQLError extends Error { * @public */ this.rawClassification = diagnosticRecord?._classification ?? undefined + /** + * Represents the name for the type of error, inherited from base JavaScript {@link Error}. + * Will be 'GQLError' for {@link GQLError}s and 'Neo4jError' for {@link Neo4jError}s. + * + * @type {string} + * @public + */ this.name = 'GQLError' } @@ -171,6 +178,11 @@ class Neo4jError extends GQLError { * Optional error code. Will be populated when error originates in the database. */ code: string + + /** + * Whether the request that caused this error can be safely retried without duplicate commits on the server. + * This does not apply when running auto-commit transactions using {@link Session#run} + */ retriable: boolean /** @@ -195,7 +207,21 @@ class Neo4jError extends GQLError { */ this.code = code + /** + * The name of the type of error. + * + * @type {string} + * @public + */ this.name = 'Neo4jError' + + /** + * If the error is considered retriable. + * This does not apply when running auto-commit transactions using {@link Session#run} + * + * @type {boolean} + * @public + */ this.retriable = _isRetriableCode(code) } diff --git a/packages/neo4j-driver-lite/esdoc.json b/packages/neo4j-driver-lite/esdoc.json index e55c34a8d..82ec6ea40 100644 --- a/packages/neo4j-driver-lite/esdoc.json +++ b/packages/neo4j-driver-lite/esdoc.json @@ -36,7 +36,7 @@ "enable": false }, "brand": { - "title": "Neo4j Bolt Lite Driver 5.x for JavaScript", + "title": "Neo4j Bolt Lite Driver 6.x for JavaScript", "repository": "https://github.com/neo4j/neo4j-javascript-driver" } } diff --git a/packages/neo4j-driver/esdoc.json b/packages/neo4j-driver/esdoc.json index 9db5028d2..935e8566e 100644 --- a/packages/neo4j-driver/esdoc.json +++ b/packages/neo4j-driver/esdoc.json @@ -36,7 +36,7 @@ "enable": true }, "brand": { - "title": "Neo4j Bolt Driver 5.x for JavaScript", + "title": "Neo4j Bolt Driver 6.x for JavaScript", "repository": "https://github.com/neo4j/neo4j-javascript-driver" } }