/** * Graph Error * * Custom error class for graph database operations * As documented in overview.md */ import { GraphErrorType } from '../types/enums'; /** * Custom error class for graph database operations */ export declare class GraphError extends Error { /** Error type */ readonly type: GraphErrorType; /** Original error if wrapped */ readonly originalError?: Error; /** Additional error details */ readonly details?: Record; constructor(message: string, type?: GraphErrorType, originalError?: Error, details?: Record); /** * Create a connection error */ static connectionError(message: string, originalError?: Error): GraphError; /** * Create a query error */ static queryError(message: string, originalError?: Error, details?: Record): GraphError; /** * Create a validation error */ static validationError(message: string, details?: Record): GraphError; /** * Create a not found error */ static notFoundError(message: string): GraphError; /** * Create a constraint violation error */ static constraintError(message: string, originalError?: Error, details?: Record): GraphError; /** * Create a transaction error */ static transactionError(message: string, originalError?: Error): GraphError; /** * Create a timeout error */ static timeoutError(message: string): GraphError; /** * Create an authentication error */ static authenticationError(message: string): GraphError; /** * Create a configuration error */ static configurationError(message: string, details?: Record): GraphError; /** * Create an unsupported operation error */ static unsupportedOperationError(operation: string, graphType: string): GraphError; /** * Wrap an unknown error as a GraphError */ static wrap(error: unknown, defaultType?: GraphErrorType): GraphError; /** * Detect error type from error message */ private static detectErrorType; /** * Convert error to JSON representation */ toJSON(): Record; }