prettier
This commit is contained in:
parent
2df723804b
commit
b732ab4085
2 changed files with 8 additions and 9 deletions
|
|
@ -259,7 +259,7 @@ app.get("/stdio", async (req, res) => {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof SseError && error.code === 401) {
|
if (error instanceof SseError && error.code === 401) {
|
||||||
console.error(
|
console.error(
|
||||||
"Received 401 Unauthorized from MCP server. Authentication failure."
|
"Received 401 Unauthorized from MCP server. Authentication failure.",
|
||||||
);
|
);
|
||||||
res.status(401).json(error);
|
res.status(401).json(error);
|
||||||
return;
|
return;
|
||||||
|
|
@ -305,7 +305,6 @@ app.get("/stdio", async (req, res) => {
|
||||||
transportToClient: webAppTransport,
|
transportToClient: webAppTransport,
|
||||||
transportToServer: serverTransport,
|
transportToServer: serverTransport,
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error in /stdio route:", error);
|
console.error("Error in /stdio route:", error);
|
||||||
res.status(500).json(error);
|
res.status(500).json(error);
|
||||||
|
|
@ -323,7 +322,7 @@ app.get("/sse", async (req, res) => {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof SseError && error.code === 401) {
|
if (error instanceof SseError && error.code === 401) {
|
||||||
console.error(
|
console.error(
|
||||||
"Received 401 Unauthorized from MCP server. Authentication failure."
|
"Received 401 Unauthorized from MCP server. Authentication failure.",
|
||||||
);
|
);
|
||||||
res.status(401).json(error);
|
res.status(401).json(error);
|
||||||
return;
|
return;
|
||||||
|
|
@ -355,7 +354,6 @@ app.get("/sse", async (req, res) => {
|
||||||
transportToServer: serverTransport,
|
transportToServer: serverTransport,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error in /sse route:", error);
|
console.error("Error in /sse route:", error);
|
||||||
res.status(500).json(error);
|
res.status(500).json(error);
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,9 @@ function onClientError(error: Error) {
|
||||||
|
|
||||||
function onServerError(error: Error) {
|
function onServerError(error: Error) {
|
||||||
if (
|
if (
|
||||||
(error?.message && error.message.includes("Error POSTing to endpoint (HTTP 404)")) ||
|
(error?.message &&
|
||||||
(error?.cause && JSON.stringify(error.cause).includes('ECONNREFUSED'))
|
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 {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue