From ebc1b0929864fbc0cd7ea1c65cca86bb95bce33f Mon Sep 17 00:00:00 2001 From: Michcio Date: Mon, 10 Oct 2022 20:03:10 +0200 Subject: [PATCH] Tear out the easily breaking early boot error page --- packages/backend/src/server/web/boot.js | 55 ------------------------- 1 file changed, 55 deletions(-) diff --git a/packages/backend/src/server/web/boot.js b/packages/backend/src/server/web/boot.js index e82de8e14..32ffba6fb 100644 --- a/packages/backend/src/server/web/boot.js +++ b/packages/backend/src/server/web/boot.js @@ -13,13 +13,6 @@ // ブロックの中に入れないと、定義した変数がブラウザのグローバルスコープに登録されてしまい邪魔なので (async () => { - window.onerror = (e) => { - renderError('SOMETHING_HAPPENED', e); - }; - window.onunhandledrejection = (e) => { - renderError('SOMETHING_HAPPENED_IN_PROMISE', e); - }; - const v = localStorage.getItem('v') || VERSION; //#region Detect language & fetch translations @@ -102,54 +95,6 @@ document.head.appendChild(style); } - // eslint-disable-next-line no-inner-declarations - function renderError(code, details) { - let errorsElement = document.getElementById('errors'); - if (!errorsElement) { - document.getElementsByTagName("head")[0].insertAdjacentHTML( - "beforeend", - ``); - document.documentElement.innerHTML = ` - - - - - -

An error has occurred!

- -

Don't worry, it's (probably) not your fault.

-

If the problem persists after refreshing, please contact your instance's administrator.
You may also try the following options:

- - - -
- - - -
- - - -
-
- `; - - errorsElement = document.getElementById('errors'); - } - - const detailsElement = document.createElement('details'); - detailsElement.innerHTML = `
ERROR CODE: ${code}${JSON.stringify(details)}`; - errorsElement.appendChild(detailsElement); - } - // eslint-disable-next-line no-inner-declarations async function checkUpdate() { // TODO: サーバーが落ちている場合などのエラーハンドリング