/** * Strip paths, URLs, and stack traces from user-facing error strings. */ /** * Sanitize an error message by removing sensitive information. * * @param error - The error to sanitize (Error object or string) * @param context - Optional context to prepend to the message * @returns Sanitized error message safe for end users * * @example * try { * await fetch('https://api.example.com'); * } catch (e) { * const safeMessage = sanitizeErrorMessage(e, 'fetching data'); * // Returns: "Error fetching data: Connection refused" * } */ export declare function sanitizeErrorMessage(error: Error | string, context?: string): string; /** * Extract a simple, user-friendly message from an error. * More aggressive sanitization than sanitizeErrorMessage. * * @param error - The error to extract message from * @returns Simple user-friendly message * * @example * const userMessage = extractUserMessage(new Error('Network timeout at /internal/path')); * // Returns: "Network timeout" */ export declare function extractUserMessage(error: Error): string; /** * Create a safe error for re-throwing. * Preserves the error type but sanitizes the message. * * @param error - The original error * @param context - Optional context for the error * @returns New Error with sanitized message */ export declare function createSafeError(error: Error, context?: string): Error; //# sourceMappingURL=errorSanitizer.d.ts.map