import { PlatformError } from "./errors.js"; //#region src/lib/wrap-neon-error.d.ts /** * Context the wrapper attaches to every PlatformError so consumers can debug without * digging into the raw axios stack. */ interface NeonErrorContext { /** Short label of the operation that failed, e.g. `getProject(proj-foo)` or `createBranch`. */ op: string; /** Optional project id when the operation is project-scoped. */ projectId?: string; } /** * Turn a raw error from `@neondatabase/api-client` (axios under the hood) into a typed * {@link PlatformError} whose message includes: * * 1. What operation was attempted (`op`, e.g. `getProject(proj-foo)`). * 2. Why it failed in human terms (e.g. "API key is unauthorized"). * 3. The exact Neon API error message + request id (when present) for support tickets. * 4. A concrete next action ("Generate a new key at …", "Pass `projectId`", …). * * Non-axios errors are passed through unchanged (a regular `Error` already has a useful * stack trace; wrapping it would lose information without adding value). */ declare function wrapNeonError(err: unknown, context: NeonErrorContext): PlatformError | unknown; //#endregion export { NeonErrorContext, wrapNeonError }; //# sourceMappingURL=wrap-neon-error.d.ts.map