/** * PostgreSQL Core Tools - Error Helpers * * Shared helpers for formatting PostgreSQL errors into structured * responses. The actual error parsing logic lives in error-parser.ts. */ import type { ErrorResponse } from "../../../../types/error-types.js"; import type { ErrorContext } from "./error-parser.js"; export { parsePostgresError } from "./error-parser.js"; export type { ErrorContext } from "./error-parser.js"; /** * Wrapper around parsePostgresError that returns the structured error message * as a string instead of throwing. Use this in handler catch blocks where you * want to return `{ success: false, error: formatPostgresError(...) }`. * * parsePostgresError always throws — this function catches the throw and * extracts the message for structured error responses. */ export declare function formatPostgresError(error: unknown, context: ErrorContext): string; /** * Canonical error formatter returning a rich ErrorResponse. * Part of the harmonized error handling standard across MCP projects. * * Combines: * - PostgresMcpError.toResponse() for typed errors * - parsePostgresError() for PG-specific error code mapping * - Zod validation path extraction * - Fallback for unknown errors */ export declare function formatHandlerErrorResponse(error: unknown, context: ErrorContext): ErrorResponse; //# sourceMappingURL=error-helpers.d.ts.map