diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-09-11 12:21:51 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-09-11 12:21:51 +0200 |
commit | 34f2c0acdb1f84bb28581e66078cb26313fd5415 (patch) | |
tree | c26557a61878140295bb1ab26e446b41b8ef8a31 /modules/luci-base/luasrc | |
parent | a0d12945661f2daa60dd1c245b0a94e4cfd43d9b (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')
-rw-r--r-- | modules/luci-base/luasrc/view/view.htm | 5 |
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 bddd8e446..9220ecf29 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%> |