mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-18 00:55:35 +00:00
Co-authored-by: Mikael Finstad <finstaden@gmail.com> Co-authored-by: Nick Rutten <2504906+nickrttn@users.noreply.github.com> Co-authored-by: Murderlon <merlijn@soverin.net> Co-authored-by: Artur Paikin <artur@arturpaikin.com>
19 lines
440 B
TypeScript
19 lines
440 B
TypeScript
class NetworkError extends Error {
|
|
public cause: unknown
|
|
|
|
public isNetworkError: true
|
|
|
|
public request: null | XMLHttpRequest
|
|
|
|
constructor(error: unknown, xhr: null | XMLHttpRequest = null) {
|
|
super(
|
|
`This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.`,
|
|
)
|
|
|
|
this.cause = error
|
|
this.isNetworkError = true
|
|
this.request = xhr
|
|
}
|
|
}
|
|
|
|
export default NetworkError
|