try to call out when #187 happens
This commit is contained in:
parent
c696a75f88
commit
e0c8be3a9a
1 changed files with 12 additions and 1 deletions
|
@ -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() {
|
||||
|
|
Reference in a new issue