prompt-plus-plus-mcp
Version:
Advanced MCP server with 44+ metaprompt strategies including AI Core Principles, Vibe Coding Rules, and metadata-driven intelligent selection
27 lines • 988 B
TypeScript
import { BaseError, ErrorCode } from './errors.js';
interface ErrorMetrics {
total: number;
byCode: Record<string, number>;
bySeverity: Record<string, number>;
lastError?: BaseError;
}
type RecoveryStrategy = (error: BaseError) => Promise<any>;
export declare class ErrorHandler {
private metrics;
private recoveryStrategies;
private suppressInProduction;
private customLogger;
constructor(customLogger?: any);
setSuppressInProduction(suppress: boolean): void;
registerRecovery(code: ErrorCode, strategy: RecoveryStrategy): void;
handle(error: Error | BaseError | unknown): Promise<any>;
private normalizeError;
private updateMetrics;
private logError;
getMetrics(): ErrorMetrics;
resetMetrics(): void;
}
export declare const errorHandler: ErrorHandler;
export declare function handleError<T>(operation: () => Promise<T>, context?: Record<string, any>): Promise<T>;
export {};
//# sourceMappingURL=error-handler.d.ts.map