/** * postgres-mcp - Error Types * * Custom error classes for postgres-mcp operations. * Follows the harmonized error handling standard with * category, suggestion, recoverable flag, auto-refinement, and toResponse(). */ import { ErrorCategory } from "./error-types.js"; import type { ErrorResponse } from "./error-types.js"; /** * Base error class for postgres-mcp with enhanced diagnostics */ export declare class PostgresMcpError extends Error { /** Error category for classification */ readonly category: ErrorCategory; /** Module-prefixed error code (e.g., CONNECTION_ERROR) */ readonly code: string; /** Actionable suggestion for resolving the error */ readonly suggestion: string | undefined; /** Additional error details */ readonly details: Record | undefined; /** Whether the error is recoverable (can retry) */ readonly recoverable: boolean; constructor(message: string, code: string, category: ErrorCategory, options?: { suggestion?: string | undefined; details?: Record | undefined; recoverable?: boolean | undefined; cause?: Error | undefined; }); /** * Convert to structured response object */ toResponse(): ErrorResponse; } /** * Database connection error */ export declare class ConnectionError extends PostgresMcpError { constructor(message: string, details?: Record, options?: { cause?: Error; }); } /** * Connection pool error */ export declare class PoolError extends PostgresMcpError { constructor(message: string, details?: Record, options?: { cause?: Error; }); } /** * Query execution error */ export declare class QueryError extends PostgresMcpError { constructor(message: string, details?: Record, options?: { cause?: Error; }); } /** * Authentication error */ export declare class AuthenticationError extends PostgresMcpError { constructor(message: string, details?: Record, options?: { cause?: Error; }); } /** * Authorization error (insufficient permissions) */ export declare class AuthorizationError extends PostgresMcpError { constructor(message: string, details?: Record, options?: { cause?: Error; }); } /** * Validation error for input parameters */ export declare class ValidationError extends PostgresMcpError { constructor(message: string, details?: Record, options?: { cause?: Error; }); } /** * Transaction error */ export declare class TransactionError extends PostgresMcpError { constructor(message: string, details?: Record, options?: { cause?: Error; }); } /** * Extension not available error */ export declare class ExtensionNotAvailableError extends PostgresMcpError { constructor(extensionName: string, details?: Record, options?: { cause?: Error; }); } //# sourceMappingURL=errors.d.ts.map