1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-01 16:28:33 +09:00

Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop

This commit is contained in:
syuilo 2022-06-26 13:28:49 +09:00
commit 3183a02824

View File

@ -14,10 +14,10 @@
// ブロックの中に入れないと、定義した変数がブラウザのグローバルスコープに登録されてしまい邪魔なので // ブロックの中に入れないと、定義した変数がブラウザのグローバルスコープに登録されてしまい邪魔なので
(async () => { (async () => {
window.onerror = (e) => { window.onerror = (e) => {
renderError('SOMETHING_HAPPENED', e.toString()); renderError('SOMETHING_HAPPENED', e);
}; };
window.onunhandledrejection = (e) => { window.onunhandledrejection = (e) => {
renderError('SOMETHING_HAPPENED_IN_PROMISE', e.toString()); renderError('SOMETHING_HAPPENED_IN_PROMISE', e);
}; };
const v = localStorage.getItem('v') || VERSION; const v = localStorage.getItem('v') || VERSION;
@ -57,7 +57,7 @@
import(`/assets/${CLIENT_ENTRY}`) import(`/assets/${CLIENT_ENTRY}`)
.catch(async e => { .catch(async e => {
await checkUpdate(); await checkUpdate();
renderError('APP_FETCH_FAILED', JSON.stringify(e)); renderError('APP_FETCH_FAILED', e);
}) })
//#endregion //#endregion
@ -104,20 +104,27 @@
// eslint-disable-next-line no-inner-declarations // eslint-disable-next-line no-inner-declarations
function renderError(code, details) { function renderError(code, details) {
document.documentElement.innerHTML = ` let errorsElement = document.getElementById('errors');
<h1>エラーが発生しました</h1> if (!errorsElement) {
<p>問題が解決しない場合は管理者までお問い合わせください以下のオプションを試すこともできます:</p> document.documentElement.innerHTML = `
<h1> An error has occurred. </h1>
<p>If the problem persists, please contact the administrator. You may also try the following options:</p>
<ul> <ul>
<li><a href="/cli">簡易クライアント</a></li> <li>Start <a href="/cli">the simple client</a></li>
<li><a href="/bios">BIOS</a></li> <li>Attempt to repair in <a href="/bios">BIOS</a></li>
<li><a href="/flush">キャッシュをクリア</a></li> <li><a href="/flush">Flush preferences and cache</a></li>
</ul> </ul>
<hr> <hr>
<code>ERROR CODE: ${code}</code> <div id="errors"></div>
<details> `;
${details}
</details> errorsElement = document.getElementById('errors');
`; }
const detailsElement = document.createElement('details');
detailsElement.innerHTML = `<summary><code>ERROR CODE: ${code}</code></summary>${JSON.stringify(details)}`;
errorsElement.appendChild(detailsElement);
} }
// eslint-disable-next-line no-inner-declarations // eslint-disable-next-line no-inner-declarations