UNPKG

simple-task-master

Version:
55 lines 1.45 kB
/** * Custom error classes for Simple Task Master */ /** * Base error class for STM-specific errors */ export declare abstract class STMError extends Error { abstract readonly code: string; constructor(message: string, cause?: Error); } /** * Error thrown when validation fails */ export declare class ValidationError extends STMError { readonly code = "VALIDATION_ERROR"; } /** * Error thrown when file system operations fail */ export declare class FileSystemError extends STMError { readonly code = "FILESYSTEM_ERROR"; } /** * Error thrown when a task is not found */ export declare class NotFoundError extends STMError { readonly code = "NOT_FOUND"; } /** * Error thrown when lock operations fail */ export declare class LockError extends STMError { readonly code = "LOCK_ERROR"; } /** * Error thrown when configuration is invalid */ export declare class ConfigurationError extends STMError { readonly code = "CONFIGURATION_ERROR"; } /** * Global error handler for unhandled errors */ export declare function handleGlobalError(error: Error): never; /** * Type guard to check if an error is an STM error */ export declare function isSTMError(error: unknown): error is STMError; /** * Type guard to check if an error has a specific code */ export declare function hasErrorCode<T extends string>(error: unknown, code: T): error is STMError & { code: T; }; //# sourceMappingURL=errors.d.ts.map