@peekalink/core
Version:
Peekalink API client library
26 lines (25 loc) • 664 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PeekalinkError = void 0;
class PeekalinkError extends Error {
ok;
status;
error;
errorCode;
message;
details;
constructor(data) {
super(data.message);
this.ok = data.ok;
this.status = data.status;
this.error = data.error;
this.errorCode = data.errorCode;
this.message = data.message;
this.details = data.details;
}
static async fromResponse(response) {
const json = await response.json();
return new PeekalinkError(json);
}
}
exports.PeekalinkError = PeekalinkError;