luci-base: dispatcher.uc: fix error500() reporting in fallback case
authorJo-Philipp Wich <[email protected]>
Mon, 7 Aug 2023 21:29:50 +0000 (23:29 +0200)
committerJo-Philipp Wich <[email protected]>
Mon, 7 Aug 2023 21:29:50 +0000 (23:29 +0200)
Fix the `error500()` fallback code path to properly output the given error
message in case rendering the error template failed.

Signed-off-by: Jo-Philipp Wich <[email protected]>
modules/luci-base/ucode/dispatcher.uc

index 39af8375ea3647d7a88e889f9099a82ecfae573e..831922ac1d6a14fc949e35854dceb231e4c066f8 100644 (file)
@@ -52,7 +52,7 @@ function error500(msg, ex) {
        }
        catch {
                http.write('<!--]]>--><!--\'>--><!--">-->\n');
-               http.write(`<p>${trim(ex)}</p>\n`);
+               http.write(`<p>${trim(msg)}</p>\n`);
 
                if (ex) {
                        http.write(`<p>${trim(ex.message)}</p>\n`);