Documentation
¶
Overview ¶
Package errors centralizes public error codes and classification helpers.
Keeping protocol-facing error strings in one package gives NornicDB a single place to manage retryability, wire-code mapping, and future localization.
Index ¶
Constants ¶
const ( // TransientDeadlockDetected is the retryable wire error code for lock deadlocks. TransientDeadlockDetected = "Neo.TransientError.Transaction.DeadlockDetected" // TransientOutdated is the retryable wire error code for stale MVCC snapshots. TransientOutdated = "Neo.TransientError.Transaction.Outdated" )
Variables ¶
var ( // ErrTransactionConflict aliases the storage conflict sentinel used when an // optimistic transaction observes data changed after its snapshot. ErrTransactionConflict = storage.ErrConflict // ErrMVCCResourcePressure aliases the storage admission sentinel used when a // snapshot cannot be kept alive under current MVCC pressure. ErrMVCCResourcePressure = storage.ErrMVCCResourcePressure // ErrMVCCSnapshotGracefulCancel aliases the storage sentinel for snapshots // cancelled during high MVCC pressure. ErrMVCCSnapshotGracefulCancel = storage.ErrMVCCSnapshotGracefulCancel // ErrMVCCSnapshotHardExpired aliases the storage sentinel for snapshots // forcibly expired during critical MVCC pressure. ErrMVCCSnapshotHardExpired = storage.ErrMVCCSnapshotHardExpired // ErrTransactionDeadlock marks lock-ordering deadlocks that drivers should // retry as Neo4j-compatible transient transaction failures. ErrTransactionDeadlock = stderrors.New("transaction deadlock") // ErrMergeCommitTimeUniqueConflict marks a commit-time UNIQUE violation from // a concurrent MERGE race. Retry-aware clients can safely replay because the // winner's committed node will be observed on the next attempt. ErrMergeCommitTimeUniqueConflict = stderrors.New("merge commit-time unique conflict") // Procedure catalog lifecycle errors. ErrProcedureCatalogReadFailed = stderrors.New("cypher: procedure catalog read failed") ErrProcedureCatalogRecordDecodeFailed = stderrors.New("cypher: procedure catalog record decode failed") ErrProcedureCatalogRecordInvalid = stderrors.New("cypher: procedure catalog record invalid") ErrProcedureRegistryReloadFailed = stderrors.New("cypher: procedure registry reload failed") // DDL parse/validation errors. ErrInvalidFulltextRelationshipTypes = stderrors.New("cypher: invalid fulltext relationship types") ErrInvalidMergeChainQuery = stderrors.New("cypher: invalid merge chain query") // ErrExpressionEvaluationFailed marks expression-evaluation failures that must // surface to callers instead of being treated as literal fallback values. ErrExpressionEvaluationFailed = stderrors.New("cypher: expression evaluation failed") )
Functions ¶
func IsMergeCommitTimeUniqueConflict ¶ added in v1.1.0
IsMergeCommitTimeUniqueConflict reports whether err was explicitly tagged as a retry-safe commit-time UNIQUE violation from a MERGE race.
func MapTransientTransactionError ¶
MapTransientTransactionError maps known transaction failure sentinels to Neo4j-compatible transient transaction codes. It intentionally classifies by error reference rather than message text so localized or templated messages do not change retry semantics.
func MarkMergeCommitTimeUniqueConflict ¶ added in v1.1.0
MarkMergeCommitTimeUniqueConflict wraps a UNIQUE constraint violation with a dedicated sentinel when the caller knows it came from a retry-safe MERGE commit race. Non-UNIQUE failures are returned unchanged.
Types ¶
type Localized ¶ added in v1.3.1
type Localized = localization.LocalizedError
Localized aliases the dependency-neutral localization error carrier.
func NewLocalized ¶ added in v1.3.1
func NewLocalized(code string, message localization.Message, cause error) *Localized
NewLocalized constructs an error that preserves message identity and wrapping.