Skip to content

Stabilize Gql Error Properties #1286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions packages/core/src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { DiagnosticRecord, rawPolyfilledDiagnosticRecord } from './gql-constants
export type ErrorClassification = 'DATABASE_ERROR' | 'CLIENT_ERROR' | 'TRANSIENT_ERROR' | 'UNKNOWN'
/**
* @typedef { 'DATABASE_ERROR' | 'CLIENT_ERROR' | 'TRANSIENT_ERROR' | 'UNKNOWN' } ErrorClassification
* @experimental this is part of the preview of GQL-compliant errors
*/

const errorClassification: { [key in ErrorClassification]: key } = {
Expand Down Expand Up @@ -74,7 +73,6 @@ type Neo4jErrorCode =

/**
* Class for nested errors, to be used as causes in {@link Neo4jError}
* @experimental this class is part of the preview of GQL-compliant errors
*/
class GQLError extends Error {
gqlStatus: string
Expand Down Expand Up @@ -111,39 +109,34 @@ class GQLError extends Error {
* The GQL Status code
*
* @type {string}
* @experimental this property is part of the preview of GQL-compliant errors
* @public
*/
this.gqlStatus = gqlStatus
/**
* The GQL Status Description
*
* @type {string}
* @experimental this property is part of the preview of GQL-compliant errors
* @public
*/
this.gqlStatusDescription = gqlStatusDescription
/**
* The GQL diagnostic record
*
* @type {DiagnosticRecord}
* @experimental this property is part of the preview of GQL-compliant errors
* @public
*/
this.diagnosticRecord = diagnosticRecord
/**
* The GQL error classification, extracted from the diagnostic record
*
* @type {ErrorClassification}
* @experimental this property is part of the preview of GQL-compliant errors
* @public
*/
this.classification = _extractClassification(this.diagnosticRecord)
/**
* The GQL error classification, extracted from the diagnostic record as a raw string
*
* @type {string}
* @experimental this property is part of the preview of GQL-compliant errors
* @public
*/
this.rawClassification = diagnosticRecord?._classification ?? undefined
Expand All @@ -155,7 +148,6 @@ class GQLError extends Error {
* The goal of this method is provide a serialized object for human inspection.
*
* @type {string}
* @experimental this is part of the preview of GQL-compliant errors
* @public
*/
public get diagnosticRecordAsJsonString (): string {
Expand Down Expand Up @@ -236,7 +228,6 @@ function newError (message: string, code?: Neo4jErrorCode, cause?: Error, gqlSta
* @param {String} [gqlStatusDescription]
* @param {DiagnosticRecord} diagnosticRecord - the error message
* @return {Neo4jError} an {@link Neo4jError}
* @experimental this is part of the preview of GQL-compliant errors
* @private
*/
function newGQLError (message: string, cause?: Error, gqlStatus?: string, gqlStatusDescription?: string, diagnosticRecord?: DiagnosticRecord): GQLError {
Expand Down
9 changes: 0 additions & 9 deletions packages/neo4j-driver-deno/lib/core/error.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.