luci-base: runtime.uc: fix error500() invocation on theme failure
authorJo-Philipp Wich <jo@mein.io>
Mon, 7 Aug 2023 21:36:36 +0000 (23:36 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 7 Aug 2023 21:36:36 +0000 (23:36 +0200)
In case no single theme could be loaded successfully, the runtime class
failed to properly invoke the `error500()` method, which is only available
through the passed environment at this point.

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

index e460127e2c9dbdb31b7064dfb2790cdd379b1a26..f14bf74480c8d6c6eab1fc8f88b4f7d0b12fbb24 100644 (file)
@@ -173,7 +173,7 @@ export default function(env) {
                }
 
                if (!media)
-                       error500(`Unable to render any theme header template, last error was:\n${status}`);
+                       env.dispatcher.error500(`Unable to render any theme header template, last error was:\n${status}`);
        }
 
        self.env.media = media;