aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_http_files.lua
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
commit3da97b1e1eea5a4f8fd44988edf20997eb600d58 (patch)
treece48b2e68265fd0bf35507fbb3fdd3e6253e2afc /plugins/mod_http_files.lua
parent592242699a859dc18fb683b9264bfc33b1107dcb (diff)
downloadprosody-3da97b1e1eea5a4f8fd44988edf20997eb600d58.tar.gz
prosody-3da97b1e1eea5a4f8fd44988edf20997eb600d58.zip
mod_http_files: Log the error if we can't open or read a file
Diffstat (limited to 'plugins/mod_http_files.lua')
-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("%.([^./]+)$");