mysterium-vpn-js
Version:
Javascript SDK for Mysterium node
23 lines (22 loc) • 757 B
JavaScript
;
/**
* Copyright (c) 2022 BlockDev AG
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.APIError = exports.CONTENT_TYPE_ERR_V1 = void 0;
exports.CONTENT_TYPE_ERR_V1 = 'application/vnd.mysterium.error+json';
class APIError extends Error {
constructor(originalErr) {
super(originalErr.error.message);
Object.setPrototypeOf(this, APIError.prototype);
this.response = originalErr;
}
human() {
var _a;
return (_a = this.response.error.detail) !== null && _a !== void 0 ? _a : this.response.error.message;
}
}
exports.APIError = APIError;