MCPcopy Create free account
hub / github.com/developmentseed/stac-react / ApiError

Class ApiError

src/utils/ApiError.ts:7–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5 * Extends the native Error class with HTTP response details.
6 */
7export class ApiError extends Error {
8 status: number;
9 detail?: GenericObject | string;
10 url?: string;
11
12 constructor(message: string, status: number, detail?: GenericObject | string, url?: string) {
13 super(message);
14 this.name = 'ApiError';
15 this.status = status;
16 this.detail = detail;
17 this.url = url;
18
19 // Maintains proper stack trace for where our error was thrown
20 // Note: Error.captureStackTrace is a V8-only feature (Node.js, Chrome)
21 if (Error.captureStackTrace) {
22 Error.captureStackTrace(this, ApiError);
23 }
24 }
25}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected