UNPKG

crann

Version:

Effortless State Synchronization for Web Extensions

60 lines (59 loc) 1.72 kB
/** * Crann Error Classes * * Custom error types for better debugging and error handling. */ /** * Base error class for all Crann errors. */ export declare class CrannError extends Error { constructor(message: string); } /** * Thrown when there's an issue with the config schema. */ export declare class ConfigError extends CrannError { readonly field?: string | undefined; constructor(message: string, field?: string | undefined); } /** * Thrown when a store or agent has been destroyed/disconnected. */ export declare class LifecycleError extends CrannError { readonly storeName: string; readonly entity: "store" | "agent"; constructor(storeName: string, entity: "store" | "agent"); } /** * Thrown when there's a connection issue. */ export declare class ConnectionError extends CrannError { readonly storeName: string; readonly reason?: string | undefined; constructor(message: string, storeName: string, reason?: string | undefined); } /** * Thrown when an action execution fails. */ export declare class ActionError extends CrannError { readonly actionName: string; readonly storeName: string; readonly reason: string; constructor(actionName: string, storeName: string, reason: string); } /** * Thrown when action validation fails. */ export declare class ValidationError extends CrannError { readonly actionName: string; readonly storeName: string; readonly reason: string; constructor(actionName: string, storeName: string, reason: string); } /** * Thrown when there's a storage key collision. */ export declare class StorageCollisionError extends CrannError { readonly storeName: string; constructor(storeName: string); }