UNPKG

@dollhousemcp/mcp-server

Version:

DollhouseMCP - A Model Context Protocol (MCP) server that enables dynamic AI persona management from markdown files, allowing Claude and other compatible AI assistants to activate and switch between different behavioral personas.

42 lines 1.41 kB
/** * SecureErrorHandler - Sanitizes error messages to prevent information disclosure * * SECURITY: Addresses Issue #206 - Information Disclosure via Error Messages * - Prevents exposure of file paths, system details, and internal structure * - Maps system errors to safe user-friendly messages * - Preserves full error details for secure logging * - Different behavior for production vs development environments */ export interface SanitizedError { message: string; code?: string; requestId?: string; } export declare class SecureErrorHandler { private static readonly SANITIZATION_PATTERNS; private static readonly ERROR_MAP; /** * Sanitize an error for safe display to users */ static sanitizeError(error: any, requestId?: string): SanitizedError; /** * Get a safe, user-friendly error message */ private static getSafeErrorMessage; /** * Sanitize error messages to remove sensitive information */ private static sanitizeErrorMessage; /** * Create a user-friendly error response */ static createErrorResponse(error: any, requestId?: string): { success: false; error: SanitizedError; }; /** * Wrap an async function with error handling */ static wrapAsync<T extends (...args: any[]) => Promise<any>>(fn: T, context?: string): T; } //# sourceMappingURL=errorHandler.d.ts.map