luci-base: dispatcher.uc: fix error500() reporting in fallback case

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 <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2023-08-07 23:29:50 +02:00
parent 48b096de1c
commit a435d4e11a

View 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`);