static: make SiteShell redirect when request > 400
This commit is contained in:
parent
7c73d2c2fb
commit
43f27c2401
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -54,6 +54,14 @@ export class SiteShell extends LitElement {
|
|||
}
|
||||
this.loading = true;
|
||||
fetch(this._url)
|
||||
.then((r) => {
|
||||
if (r.ok) {
|
||||
return r;
|
||||
}
|
||||
console.log(`passbook/site-shell: Request failed ${this._url}`);
|
||||
window.location.hash = "#/";
|
||||
throw new Error("Request failed");
|
||||
})
|
||||
.then((r) => r.text())
|
||||
.then((t) => {
|
||||
this.querySelector("[slot=body]")!.innerHTML = t;
|
||||
|
|
Reference in New Issue