MCPcopy Create free account
hub / github.com/agentrpc/agentrpc / AgentRPCAPIError

Class AgentRPCAPIError

sdk-node/src/errors.ts:21–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21export class AgentRPCAPIError extends Error {
22 constructor(message: string, response: unknown) {
23 let msg = message;
24
25 if (response instanceof Error) {
26 msg += `\n${response.message}`;
27 } else if (typeof response === "string") {
28 msg += `\n${response}`;
29 } else if (typeof response === "object") {
30 msg += `\n${JSON.stringify(response)}`;
31 }
32
33 super(msg);
34 this.name = "InferableAPIError";
35 }
36}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected