提交 2c975b1c 编写于 作者: C Connor Davis 提交者: Tim Neutkens

Catch errors when loading a page in case a script 404s (#6729)

* Catch errors when loading page

* return promise instead of await
上级 18af71c0
......@@ -156,11 +156,11 @@ export default class PageLoader {
}
if (document.readyState === 'complete') {
await this.loadPage(route)
return this.loadPage(route).catch((e) => {})
} else {
return new Promise((resolve, reject) => {
window.addEventListener('load', () => {
this.loadPage(route).then(() => resolve(), reject)
this.loadPage(route).then(() => resolve(), () => resolve())
})
})
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册