Enable stack tracebacks for 500 errors
This commit is contained in:
parent
2b0c0485e8
commit
3b7bb9c82f
1 changed files with 4 additions and 5 deletions
|
@ -66,6 +66,7 @@ function error404(message)
|
||||||
if not luci.util.copcall(luci.template.render, "error404") then
|
if not luci.util.copcall(luci.template.render, "error404") then
|
||||||
luci.http.prepare_content("text/plain")
|
luci.http.prepare_content("text/plain")
|
||||||
luci.http.write(message)
|
luci.http.write(message)
|
||||||
|
luci.util.perror(message)
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
@ -113,11 +114,9 @@ function httpdispatch(request)
|
||||||
table.insert(context.request, node)
|
table.insert(context.request, node)
|
||||||
end
|
end
|
||||||
|
|
||||||
local stat, err = util.copcall(dispatch, context.request)
|
local stat, err = util.coxpcall(function()
|
||||||
if not stat then
|
dispatch(context.request)
|
||||||
luci.util.perror(err)
|
end, error500)
|
||||||
error500(err)
|
|
||||||
end
|
|
||||||
|
|
||||||
luci.http.close()
|
luci.http.close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue