@sap/xssec
Version:
XS Advanced Container Security API for node.js
51 lines (40 loc) • 1.04 kB
JavaScript
const NetworkError = require("./NetworkError");
class ResponseError extends NetworkError {
#url;
#request;
#responseCode;
#responseText;
constructor(url, request, responseCode, responseText, message = `HTTP response from ${url} was ${responseCode}: ${responseText}.`) {
super(message);
this.name = "ResponseError";
this.url = url;
this.request = request;
this.responseCode = responseCode;
this.responseText = responseText;
}
get url() {
return this.#url;
}
set url(value) {
this.#url = value;
}
get request() {
return this.#request;
}
set request(value) {
this.#request = value;
}
get responseCode() {
return this.#responseCode;
}
set responseCode(value) {
this.#responseCode = value;
}
get responseText() {
return this.#responseText;
}
set responseText(value) {
this.#responseText = value;
}
}
module.exports = ResponseError;