Merge pull request #554 from nabuskey/con-refused
fix connection refused error message
This commit is contained in:
commit
f2cae3d825
1 changed files with 3 additions and 5 deletions
|
|
@ -6,12 +6,10 @@ function onClientError(error: Error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onServerError(error: Error) {
|
function onServerError(error: Error) {
|
||||||
if (
|
if (error?.cause && JSON.stringify(error.cause).includes("ECONNREFUSED")) {
|
||||||
(error?.message &&
|
|
||||||
error.message.includes("Error POSTing to endpoint (HTTP 404)")) ||
|
|
||||||
(error?.cause && JSON.stringify(error.cause).includes("ECONNREFUSED"))
|
|
||||||
) {
|
|
||||||
console.error("Connection refused. Is the MCP server running?");
|
console.error("Connection refused. Is the MCP server running?");
|
||||||
|
} else if (error.message && error.message.includes("404")) {
|
||||||
|
console.error("Error accessing endpoint (HTTP 404)");
|
||||||
} else {
|
} else {
|
||||||
console.error("Error from MCP server:", error);
|
console.error("Error from MCP server:", error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue