diff options
author | Matthew Wild <mwild1@gmail.com> | 2013-04-22 12:35:52 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2013-04-22 12:35:52 +0100 |
commit | c63dc9181d8a0b747a297e7b108960eac8e18897 (patch) | |
tree | 6c58b0d65feb36b1f99fee431faadd042cf4f5ec /net/http/server.lua | |
parent | 2592e23bae846f2044488f01a739e9d210e30f3e (diff) | |
download | prosody-c63dc9181d8a0b747a297e7b108960eac8e18897.tar.gz prosody-c63dc9181d8a0b747a297e7b108960eac8e18897.zip |
mod_c2s, mod_s2s, net.http, net.http.server: Improve tracebacks (omit traceback function), to make it clearer where an error occured
Diffstat (limited to 'net/http/server.lua')
-rw-r--r-- | net/http/server.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/http/server.lua b/net/http/server.lua index 577b05ef..dec7da19 100644 --- a/net/http/server.lua +++ b/net/http/server.lua @@ -9,7 +9,7 @@ local pairs = pairs; local s_upper = string.upper; local setmetatable = setmetatable; local xpcall = xpcall; -local debug = debug; +local traceback = debug.traceback; local tostring = tostring; local codes = require "net.http.codes"; @@ -88,7 +88,7 @@ local _1, _2, _3; local function _handle_request() return handle_request(_1, _2, _3); end local last_err; -local function _traceback_handler(err) last_err = err; log("error", "Traceback[http]: %s: %s", tostring(err), debug.traceback()); end +local function _traceback_handler(err) last_err = err; log("error", "Traceback[httpserver]: %s", traceback(tostring(err), 2)); end events.add_handler("http-error", function (error) return "Error processing request: "..codes[error.code]..". Check your error log for more information."; end, -1); |