luci-base: expose sysauth rendering errors
authorJo-Philipp Wich <jo@mein.io>
Mon, 21 Nov 2022 11:20:58 +0000 (12:20 +0100)
committerJo-Philipp Wich <jo@mein.io>
Mon, 21 Nov 2022 11:20:58 +0000 (12:20 +0100)
In case a theme shipped sysauth.htm failed to render/execute, expose the
exception error details in the ui theme fallback indicator.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/ucode/dispatcher.uc

index 89ff39193939a1e9b065f18fca58add835da3c0f..b08a2f8b7ae8f6d6d840d410ce96205988664957 100644 (file)
@@ -921,6 +921,7 @@ dispatch = function(_http, path) {
                                                runtime.render(`themes/${basename(runtime.env.media)}/sysauth`, scope);
                                        }
                                        catch (e) {
+                                               runtime.env.media_error = `${e}`;
                                                runtime.render('sysauth', scope);
                                        }