@shirokuma-library/mcp-knowledge-base
Version:
Shirokuma MCP Server for comprehensive knowledge management including issues, plans, documents, and work sessions. All stored data is structured for AI processing, not human readability.
13 lines (12 loc) • 475 B
JavaScript
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
export class ErrorHandler {
static handle(error) {
if (error instanceof McpError) {
return error;
}
if (error instanceof Error) {
return new McpError(ErrorCode.InternalError, error.message, { originalError: error.name });
}
return new McpError(ErrorCode.InternalError, 'An unknown error occurred', { error: String(error) });
}
}