UNPKG

sql-talk

Version:

SQL Talk - 自然言語をSQLに変換するMCPサーバー(安全性保護・SSHトンネル対応) / SQL Talk - MCP Server for Natural Language to SQL conversion with safety guards and SSH tunnel support

52 lines 1.96 kB
/** * Custom error classes for MCP NL-to-SQL server */ export declare class MCPError extends Error { readonly code: string; readonly statusCode: number; readonly details?: Record<string, unknown>; constructor(message: string, code: string, statusCode?: number, details?: Record<string, unknown>); toJSON(): Record<string, unknown>; } export declare class ConfigurationError extends MCPError { constructor(message: string, details?: Record<string, unknown>); } export declare class DatabaseError extends MCPError { constructor(message: string, details?: Record<string, unknown>); } export declare class SecurityError extends MCPError { constructor(message: string, details?: Record<string, unknown>); } export declare class ValidationError extends MCPError { constructor(message: string, details?: Record<string, unknown>); } export declare class SqlLintError extends MCPError { constructor(message: string, details?: Record<string, unknown>); } export declare class AuthorizationError extends MCPError { constructor(message: string, details?: Record<string, unknown>); } export declare class TimeoutError extends MCPError { constructor(message: string, details?: Record<string, unknown>); } export declare class SchemaError extends MCPError { constructor(message: string, details?: Record<string, unknown>); } /** * Error handler utility functions */ export declare class ErrorHandler { static isMCPError(error: unknown): error is MCPError; static isKnownError(error: unknown): boolean; static formatError(error: unknown): { message: string; code?: string; details?: Record<string, unknown>; }; static createSafeError(error: unknown): MCPError; } /** * Async error wrapper for better error handling */ export declare function asyncHandler<T extends unknown[], R>(fn: (...args: T) => Promise<R>): (...args: T) => Promise<R>; //# sourceMappingURL=errors.d.ts.map