uppy/packages/@uppy/utils/src/ErrorWithCause.js
2022-05-23 09:40:50 +02:00

13 lines
335 B
JavaScript

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