export class APIError extends Error { constructor(endpoint, code, message, data) { super(`APIError: ${message}`); this.endpoint = endpoint; this.code = code; this.data = data; Error.captureStackTrace(this, APIError); } getEndpoint() { return this.endpoint; } getCode() { return this.code; } getData() { return this.data; } }