UNPKG

@pgxsinkit/pgwasm

Version:
80 lines • 3.31 kB
export declare const FS_ERRNO: { readonly EBADF: 8; readonly EEXIST: 20; readonly EINVAL: 28; /** The core reports this only as {@link StoreFailedError}'s `code`: the store failed, not the caller. */ readonly EIO: 29; readonly EISDIR: 31; readonly ELOOP: 32; readonly ENOENT: 44; readonly ENOTDIR: 54; readonly ENOTEMPTY: 55; readonly EXDEV: 75; }; export type FsErrorName = keyof typeof FS_ERRNO; /** A normal virtual-filesystem rejection. The live store remains usable. */ export declare class FsError extends Error { readonly code: number; readonly operation: string | undefined; readonly path: string | undefined; constructor(name: FsErrorName, message: string, options?: { operation?: string; path?: string; cause?: unknown; }); } /** A configured or format hard limit was reached. */ export declare class StoreLimitError extends Error { readonly storeCode = "STORE_LIMIT"; constructor(message: string, options?: ErrorOptions); } /** Activated bytes violate format integrity or semantic invariants. */ export declare class CorruptStoreError extends Error { readonly storeCode = "CORRUPT_STORE"; constructor(message: string, options?: ErrorOptions); } /** The store identifies a different format and must be deleted in full. */ export declare class StoreRecreationRequiredError extends Error { readonly storeCode = "STORE_RECREATION_REQUIRED"; constructor(message: string, options?: ErrorOptions); } /** A supplied creation extent size disagrees with the existing store identity. */ export declare class ExtentSizeMismatchError extends Error { readonly storeCode = "EXTENT_SIZE_MISMATCH"; constructor(expected: number, actual: number); } /** Another live instance owns at least one required exclusive OPFS handle. */ export declare class StoreOwnedError extends Error { readonly storeCode = "STORE_OWNED"; constructor(options?: ErrorOptions); } /** The dedicated store directory contains an entry outside the exact owned set. */ export declare class UnexpectedStoreEntryError extends Error { readonly storeCode = "UNEXPECTED_STORE_ENTRY"; constructor(entryName: string); } /** The host attempted a non-awaited sync, proving the factory wiring was bypassed. */ export declare class DurabilityModeMismatchError extends Error { readonly storeCode = "DURABILITY_MODE_MISMATCH"; constructor(); } /** The adapter was used after all owned handles were closed. */ export declare class StoreClosedError extends Error { readonly storeCode = "STORE_CLOSED"; constructor(); } /** * The live instance is poisoned and retains its first terminal cause. * * It carries a numeric `code` (`EIO`), as `FsError` does, so an engine's filesystem bridge that maps * coded errors to errnos (pgwasm's) reports an I/O error to the engine instead of letting an exception * unwind through it. It is deliberately NOT an `FsError`: an `FsError` leaves the store usable, a * `StoreFailedError` means every later call fails the same way until close. */ export declare class StoreFailedError extends Error { readonly storeCode = "STORE_FAILED"; readonly code: number; readonly cause: unknown; constructor(cause: unknown); } //# sourceMappingURL=errors.d.ts.map