# HG changeset patch # User Waqas Hussain # Date 1327447208 -18000 # Node ID 1a575bcbc8432dd3fd618d8be851725d4c9b9ce9 # Parent d26436bdfd5c75e5731606a56800f64dd161fbf5 mod_muc_log_http: Return a proper 404 Not Found page on missing pages instead of a traceback. diff -r d26436bdfd5c -r 1a575bcbc843 mod_muc_log_http/muc_log_http/mod_muc_log_http.lua --- a/mod_muc_log_http/muc_log_http/mod_muc_log_http.lua Tue Jan 24 19:25:06 2012 +0100 +++ b/mod_muc_log_http/muc_log_http/mod_muc_log_http.lua Wed Jan 25 04:20:08 2012 +0500 @@ -86,7 +86,9 @@ end function createDoc(body, title) - assert(body, " HTTP response"); + if not body then + return { status = "404 Not Found", body = "

Page Not Found

Sorry, we couldn't find what you were looking for :(" }; + end body = body:gsub("%%", "%%%%"); return html.doc:gsub("###BODY_STUFF###", body) :gsub("muc_log", ""..(title and htmlEscape(title) or "Chatroom logs").."");