mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
try to call out when #187 happens
This commit is contained in:
parent
c696a75f88
commit
e0c8be3a9a
@ -32,11 +32,22 @@ class RequestWrapper {
|
||||
throw new HomeServerError(method, url, response.body, response.status);
|
||||
}
|
||||
}
|
||||
}, err => {
|
||||
// if this._requestResult is still set, the abort error came not from calling abort here
|
||||
if (err.name === "AbortError" && this._requestResult) {
|
||||
throw new Error(`Request ${method} ${url} was unexpectedly aborted, see #187.`);
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
abort() {
|
||||
return this._requestResult.abort();
|
||||
if (this._requestResult) {
|
||||
this._requestResult.abort();
|
||||
// to mark that it was on purpose in above rejection handler
|
||||
this._requestResult = null;
|
||||
}
|
||||
}
|
||||
|
||||
response() {
|
||||
|
Loading…
Reference in New Issue
Block a user