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 | c178786878c733d4fdfa9bd98bb030a5280be197 (patch) | |
tree | b73e613e768075eec0652aefaf2d6956a2b16566 /net/http/server.lua | |
parent | 842b340ebe3c355be231d97fe2fa8f4dd7289711 (diff) | |
download | prosody-c178786878c733d4fdfa9bd98bb030a5280be197.tar.gz prosody-c178786878c733d4fdfa9bd98bb030a5280be197.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); |