mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 03:08:34 +00:00
* Add NetworkError error type and isNetworkError utility check
* Detect network errors in tus and xhr-upload
Co-Authored-By: Ifedapo .A. Olarewaju <ifedapoolarewaju@gmail.com>
* add NetworkError check to RequestClient in companion-client
* return false if !xhr 🙈
* move catch so that only errors from _checkMinNumberOfFiles are caught — errors from uploads are logged in `upload-error` already
//cc @goto-bus-stop
* Add NetworkError to MiniXHRUpload in aws-s3
//cc @goto-bus-stop
* Add tests
//cc @ifedapoolarewaju
* pass xhr to NetworkError
* add logging in catch of uppy.upload()
* start error message with “This looks like a network error”
* originalRequest --> request, return NetworkError right away
* check for NetworkError in `delete` as well
do we need it in preflight too, @ifedapoolarewaju?
* remove redundant error message re-declaration
* _showOrLogErrorAndThrow, but don’t showInformer
Co-authored-by: Ifedapo .A. Olarewaju <ifedapoolarewaju@gmail.com>
10 lines
306 B
JavaScript
10 lines
306 B
JavaScript
class NetworkError extends Error {
|
|
constructor (error, xhr = null) {
|
|
super(`This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.\n\nSource error: [${error}]`)
|
|
|
|
this.isNetworkError = true
|
|
this.request = xhr
|
|
}
|
|
}
|
|
|
|
module.exports = NetworkError
|