This repository has been archived on 2022-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
hydrogen-web/src/matrix/error.js
2020-03-17 00:07:54 +01:00

20 lines
457 B
JavaScript

export class HomeServerError extends Error {
constructor(method, url, body, status) {
super(`${body ? body.error : status} on ${method} ${url}`);
this.errcode = body ? body.errcode : null;
this.retry_after_ms = body ? body.retry_after_ms : 0;
}
get isFatal() {
switch (this.errcode) {
}
}
}
export class RequestAbortError extends Error {
}
export class NetworkError extends Error {
}