Type guard for MCPServerError
Checks if an unknown error is an instance of MCPServerError or one of its subclasses. Useful for error handling and formatting.
Unknown error to check
true if error is an MCPServerError or subclass
try { await fetchMEPs();} catch (error) { if (isMCPServerError(error)) { console.error(`Error ${error.code}: ${error.message}`); }} Copy
try { await fetchMEPs();} catch (error) { if (isMCPServerError(error)) { console.error(`Error ${error.code}: ${error.message}`); }}
Type guard for MCPServerError
Checks if an unknown error is an instance of MCPServerError or one of its subclasses. Useful for error handling and formatting.