You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
414 B
21 lines
414 B
|
2 years ago
|
"use strict";
|
||
|
|
|
||
|
|
const hasProperty = require("./hasProperty.js");
|
||
|
|
|
||
|
|
class ErrorWithCause extends Error {
|
||
|
|
constructor(message, options) {
|
||
|
|
if (options === void 0) {
|
||
|
|
options = {};
|
||
|
|
}
|
||
|
|
|
||
|
|
super(message);
|
||
|
|
this.cause = options.cause;
|
||
|
|
|
||
|
|
if (this.cause && hasProperty(this.cause, 'isNetworkError')) {
|
||
|
|
this.isNetworkError = this.cause.isNetworkError;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
module.exports = ErrorWithCause;
|