bugyo-cloud-client
Version:
HTTP client for Bugyo Cloud
19 lines • 713 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseEndpoint = void 0;
const bugyo_cloud_client_1 = require("../../bugyo-cloud-client");
class BaseEndpoint {
constructor(loggerFactory) {
this.logger = loggerFactory.getLogger(this["constructor"]["name"]);
}
throwIfNgStatus(resp) {
if (resp.status !== 200) {
const msg = `Unexpected status ${resp.status} ${resp.statusText}.`;
this.logger.debug("Response : ", resp.data);
this.logger.error(msg);
throw new bugyo_cloud_client_1.BugyoCloudClientError(msg);
}
}
}
exports.BaseEndpoint = BaseEndpoint;
//# sourceMappingURL=base-endpoint.js.map