Home Reference Source
import {GQLError} from 'neo4j-driver-core/lib/error.js'
public class | source

GQLError

Extends:

Error → GQLError

Direct Subclass:

Neo4jError

Class for nested errors, to be used as causes in Neo4jError

Constructor Summary

Public Constructor
public

constructor(message: string, gqlStatus: string, gqlStatusDescription: string, diagnosticRecord: ErrorDiagnosticRecord, cause: Error)

Member Summary

Public Members
public

cause: Error?

Optional, nested error which caused the error

public

The GQL error classification, extracted from the diagnostic record

public

diagnosticRecord: DiagnosticRecord

The GQL diagnostic record

public get

The json string representation of the diagnostic record.

public

gqlStatus: string

The GQL Status code

public

The GQL Status Description

public

name: string

Represents the name for the type of error, inherited from base JavaScript Error.

public

The GQL error classification, extracted from the diagnostic record as a raw string

Method Summary

Public Methods
public

containsGqlCause(gqlStatus: string): boolean

Returns whether a given GqlStatus code can be found in the cause chain of the error (including the error itself).

public

findByGqlStatus(gqlStatus: string): GQLError | Neo4jError | undefined

Returns the first error in the cause chain (including the error itself) with a given GqlStatus code.

Public Constructors

public constructor(message: string, gqlStatus: string, gqlStatusDescription: string, diagnosticRecord: ErrorDiagnosticRecord, cause: Error) source

Params:

NameTypeAttributeDescription
message string

the error message

gqlStatus string

the GQL status code of the error

gqlStatusDescription string

the GQL status description of the error

diagnosticRecord ErrorDiagnosticRecord

the error diagnostic record

cause Error

Optional nested error, the cause of the error

Public Members

public cause: Error? source

Optional, nested error which caused the error

public classification: ErrorClassification source

The GQL error classification, extracted from the diagnostic record

public diagnosticRecord: DiagnosticRecord source

The GQL diagnostic record

public get diagnosticRecordAsJsonString: string source

The json string representation of the diagnostic record. The goal of this method is provide a serialized object for human inspection.

public gqlStatus: string source

The GQL Status code

public gqlStatusDescription: string source

The GQL Status Description

public name: string source

Represents the name for the type of error, inherited from base JavaScript Error. Will be 'GQLError' for GQLErrors and 'Neo4jError' for Neo4jErrors.

public rawClassification: string source

The GQL error classification, extracted from the diagnostic record as a raw string

Public Methods

public containsGqlCause(gqlStatus: string): boolean source

Returns whether a given GqlStatus code can be found in the cause chain of the error (including the error itself).

Params:

NameTypeAttributeDescription
gqlStatus string

the GqlStatus code to find

Return:

boolean

public findByGqlStatus(gqlStatus: string): GQLError | Neo4jError | undefined source

Returns the first error in the cause chain (including the error itself) with a given GqlStatus code. Returns undefined if the GqlStatus code is not present anywhere in the chain.

Params:

NameTypeAttributeDescription
gqlStatus string

the GqlStatus code to find

Return:

GQLError | Neo4jError | undefined