Software /
code /
prosody
Diff
plugins/mod_http_files.lua @ 5260:87f72452a893
mod_http_files: Log the error if we can't open or read a file
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 21 Dec 2012 16:10:45 +0100 |
parent | 5257:b125892e187c |
child | 5261:b14f02671439 |
line wrap: on
line diff
--- a/plugins/mod_http_files.lua Fri Dec 21 13:37:39 2012 +0500 +++ b/plugins/mod_http_files.lua Fri Dec 21 16:10:45 2012 +0100 @@ -115,10 +115,11 @@ 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("%.([^./]+)$");