UNPKG

@accounter/server

Version:
38 lines (37 loc) 1.36 kB
/** * Base error class for seed operations * Provides structured context for debugging seed failures */ export declare class SeedError extends Error { readonly context: Record<string, unknown>; readonly cause?: Error | undefined; constructor(message: string, context: Record<string, unknown>, cause?: Error | undefined); /** * Format error with context for logging */ toJSON(): Record<string, unknown>; } /** * Thrown when entity validation fails (invalid type, missing required fields, etc.) */ export declare class EntityValidationError extends SeedError { constructor(entityType: string, validationErrors: string[], context?: Record<string, unknown>); } /** * Thrown when attempting to reference an entity that doesn't exist */ export declare class EntityNotFoundError extends SeedError { constructor(entityType: string, identifier: Record<string, unknown>); } /** * Thrown when database constraint violation occurs during seed */ export declare class ConstraintViolationError extends SeedError { constructor(constraintName: string, operation: string, context: Record<string, unknown>, cause?: Error); } /** * Thrown when seed configuration is invalid or missing */ export declare class SeedConfigurationError extends SeedError { constructor(message: string, context?: Record<string, unknown>); }