fix connection refused error message

Signed-off-by: Manabu McCloskey <manabu.mccloskey@gmail.com>
This commit is contained in:
Manabu McCloskey 2025-06-23 22:58:54 +00:00
commit c0e9899cd4

View file

@ -6,11 +6,7 @@ function onClientError(error: Error) {
}
function onServerError(error: Error) {
if (
(error?.message &&
error.message.includes("Error POSTing to endpoint (HTTP 404)")) ||
(error?.cause && JSON.stringify(error.cause).includes("ECONNREFUSED"))
) {
if (error?.cause && JSON.stringify(error.cause).includes("ECONNREFUSED")) {
console.error("Connection refused. Is the MCP server running?");
} else {
console.error("Error from MCP server:", error);