mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
fix errors when replaying
This commit is contained in:
parent
ff9e55e49c
commit
b69efc3425
@ -1,8 +1,8 @@
|
|||||||
export class HomeServerError extends Error {
|
export class HomeServerError extends Error {
|
||||||
constructor(method, url, body) {
|
constructor(method, url, body, status) {
|
||||||
super(`${body.error} on ${method} ${url}`);
|
super(`${body ? body.error : status} on ${method} ${url}`);
|
||||||
this.errcode = body.errcode;
|
this.errcode = body ? body.errcode : null;
|
||||||
this.retry_after_ms = body.retry_after_ms;
|
this.retry_after_ms = body ? body.retry_after_ms : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
get isFatal() {
|
get isFatal() {
|
||||||
|
@ -12,7 +12,7 @@ class RequestWrapper {
|
|||||||
} else {
|
} else {
|
||||||
switch (response.status) {
|
switch (response.status) {
|
||||||
default:
|
default:
|
||||||
throw new HomeServerError(method, url, response.body);
|
throw new HomeServerError(method, url, response.body, response.status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user