UNPKG

ts3-nodejs-library

Version:
35 lines 998 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class ResponseError extends Error { constructor(error) { super(error.msg); this.id = error.id; this.msg = error.msg; this.extra_msg = error.extra_msg; this.failed_permid = error.failed_permid; if (this.extra_msg) this.message += `, ${this.extra_msg}`; if (this.failed_permid) this.message += `, failed on permid ${this.failed_permid}`; } /** * returns a string representative of this error */ toString() { return this.message; } /** * returns a json encodeable object for this error */ toJSON() { return { id: this.id, msg: this.msg, extra_msg: this.extra_msg, failed_permid: this.failed_permid, message: this.message }; } } exports.ResponseError = ResponseError; //# sourceMappingURL=ResponseError.js.map