aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-12-21 16:10:45 +0100
committerKim Alvefur <zash@zash.se>2012-12-21 16:10:45 +0100
commit92abfa2d51728cfae3ab41d4131cae5f8081d8cc (patch)
treece48b2e68265fd0bf35507fbb3fdd3e6253e2afc /plugins
parent42907ced08178a2a99662148870ff5217959bf78 (diff)
downloadprosody-92abfa2d51728cfae3ab41d4131cae5f8081d8cc.tar.gz
prosody-92abfa2d51728cfae3ab41d4131cae5f8081d8cc.zip
mod_http_files: Log the error if we can't open or read a file
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_http_files.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_http_files.lua b/plugins/mod_http_files.lua
index 43094eb4..2e906b70 100644
--- a/plugins/mod_http_files.lua
+++ b/plugins/mod_http_files.lua
@@ -115,10 +115,11 @@ function serve_file(event, path)
else
local f, err = open(full_path, "rb");
if f then
- data = f:read("*a");
+ data, err = f:read("*a");
f:close();
end
if not data then
+ module:log("debug", "Could not open or read %s. Error was %s", full_path, err);
return 403;
end
local ext = path:match("%.([^./]+)$");