Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
@@ -0,0 +1,23 @@
|
||||
export class McpHttpError extends Error {
|
||||
readonly status: number;
|
||||
readonly code: string;
|
||||
readonly headers: Record<string, string>;
|
||||
|
||||
constructor(status: number, code: string, message: string, headers: Record<string, string> = {}) {
|
||||
super(message);
|
||||
this.name = "McpHttpError";
|
||||
this.status = status;
|
||||
this.code = code;
|
||||
this.headers = headers;
|
||||
}
|
||||
}
|
||||
|
||||
export function toToolError(error: unknown): string {
|
||||
if (error instanceof McpHttpError) {
|
||||
return `${error.code}: ${error.message}`;
|
||||
}
|
||||
if (error instanceof Error) {
|
||||
return error.message;
|
||||
}
|
||||
return "Unknown MCP tool error.";
|
||||
}
|
||||
Reference in new issue
Block a user