MCPcopy Create free account
hub / github.com/instantdb/instant / constructor

Method constructor

client/packages/core/src/utils/fetch.ts:91–113  ·  view source on GitHub ↗
(error: InstantIssue)

Source from the content-addressed store, hash-verified

89 status: number;
90
91 constructor(error: InstantIssue) {
92 // Create a descriptive message based on the error
93 const message = error.body?.message || `API Error (${error.status})`;
94 super(
95 message,
96 (error.body as any).hint,
97 (error.body as any)?.traceId || (error.body as any)['trace-id'],
98 );
99
100 const actualProto = new.target.prototype;
101 if (Object.setPrototypeOf) {
102 Object.setPrototypeOf(this, actualProto);
103 }
104
105 // Maintain proper stack trace for where our error was thrown
106 if (Error.captureStackTrace) {
107 Error.captureStackTrace(this, InstantAPIError);
108 }
109
110 this.name = 'InstantAPIError';
111 this.status = error.status;
112 this.body = error.body;
113 }
114
115 get [Symbol.toStringTag]() {
116 return 'InstantAPIError';

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected