error404: flow message into template 4239/head
authorKarl Palsson <karlp@etactica.com>
Mon, 6 Jul 2020 17:35:14 +0000 (17:35 +0000)
committerKarl Palsson <karlp@etactica.com>
Tue, 7 Jul 2020 15:01:03 +0000 (15:01 +0000)
message was only being shown in the plain text case when the render
failed.

Signed-off-by: Karl Palsson <karlp@etactica.com>
modules/luci-base/luasrc/dispatcher.lua
modules/luci-base/luasrc/view/error404.htm

index 57b4e12d173d619ad7b4da81115b567947bfbbe5..6e62e253085964f90ab61aa16803cf305680a2fd 100644 (file)
@@ -394,7 +394,7 @@ function error404(message)
 
        local function render()
                local template = require "luci.template"
-               template.render("error404")
+               template.render("error404", {message=message})
        end
 
        if not util.copcall(render) then
index a762f6038b79fd4a55e683f80a9f51f8bf8f1c6f..ff151d1834c98514112f39ecbc2d4b18d146a92b 100644 (file)
@@ -7,5 +7,6 @@
 <%+header%>
 <h2 name="content">404 <%:Not Found%></h2>
 <p><%:Sorry, the object you requested was not found.%></p>
+<p><%=message%></p>
 <tt><%:Unable to dispatch%>: <%=url(unpack(luci.dispatcher.context.request))%></tt>
 <%+footer%>