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.
13 lines
335 B
13 lines
335 B
import hasProperty from './hasProperty.js'
|
|
|
|
class ErrorWithCause extends Error {
|
|
constructor (message, options = {}) {
|
|
super(message)
|
|
this.cause = options.cause
|
|
if (this.cause && hasProperty(this.cause, 'isNetworkError')) {
|
|
this.isNetworkError = this.cause.isNetworkError
|
|
}
|
|
}
|
|
}
|
|
|
|
export default ErrorWithCause
|
|
|