summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/view/view.htm
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-09-11 12:21:51 +0200
committerJo-Philipp Wich <jo@mein.io>2019-09-11 12:21:51 +0200
commit34f2c0acdb1f84bb28581e66078cb26313fd5415 (patch)
treec26557a61878140295bb1ab26e446b41b8ef8a31 /modules/luci-base/luasrc/view/view.htm
parenta0d12945661f2daa60dd1c245b0a94e4cfd43d9b (diff)
luci-base: view.htm: catch and render exceptions on view instantiation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/luasrc/view/view.htm')
-rw-r--r--modules/luci-base/luasrc/view/view.htm5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/luci-base/luasrc/view/view.htm b/modules/luci-base/luasrc/view/view.htm
index bddd8e4464..9220ecf299 100644
--- a/modules/luci-base/luasrc/view/view.htm
+++ b/modules/luci-base/luasrc/view/view.htm
@@ -2,7 +2,10 @@
<div id="view">
<div class="spinning"><%:Loading view…%></div>
- <script type="text/javascript">L.require('view.<%=view%>');</script>
+ <script type="text/javascript">L.require('view.<%=view%>').catch(function(err) {
+ L.dom.content(document.querySelector('#view'), null);
+ L.error(err);
+ });</script>
</div>
<%+footer%>