export interface MubiconErrorObject { response: any; body: any; error?: Error; } export class MubiconRequestError extends Error { _response?: any; _body?: any; constructor(o: MubiconErrorObject) { if (o.error) { super(o.error.message); this.name = o.error.name; this.stack = o.error.stack; } else { var body = JSON.stringify(o.body); super(body); } this._response = o.response; this._body = o.body; Object.setPrototypeOf(this, MubiconRequestError.prototype); } get response(): any { return this._response; } get body(): any { return this._body; } } export class HttpError extends Error {