@sap/xssec
Version:
XS Advanced Container Security API for node.js
46 lines (37 loc) • 1.21 kB
JavaScript
const NetworkError = require("./NetworkError");
/**
* An error that occurs while sending a request, e.g. when there is no network connection.
*/
class RequestError extends NetworkError {
/** @type {import("https").RequestOptions & {name: string}} */
/** @type {Error|Error[]} the original error(s) of the HTTP client for debugging. Do not code against this property as the internal HTTP client implementation may change anytime. */
constructor(url, request, originalError, message = `HTTP request [${request.name}] to ${url} could not be sent due to: ${originalError.toString()}.`) {
super(message);
this.name = "RequestError";
this.url = url;
this.request = request;
this.originalError = originalError;
}
get url() {
return this.
}
set url(value) {
this.
}
get request() {
return this.
}
set request(value) {
this.
}
get originalError() {
return this.
}
set originalError(error) {
this.
}
}
module.exports = RequestError;