mcp-chat-adapter
Version:
MCP server for OpenAI chat completion
15 lines (14 loc) • 550 B
TypeScript
import { Logger } from '../utils.js';
/**
* Standard error handler for tool functions
*
* This function:
* 1. Logs the error with consistent formatting
* 2. Handles specific error types (like ConversationNotFoundError)
* 3. Provides standardized error messages
*
* @param context - Context identifier for the log entry
* @param error - The error to handle
* @param customMessage - Optional custom error message prefix
*/
export declare function handleToolError(log: Logger, context: string, error: unknown, customMessage?: string): never;