From 3da97b1e1eea5a4f8fd44988edf20997eb600d58 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 21 Dec 2012 16:10:45 +0100 Subject: mod_http_files: Log the error if we can't open or read a file --- plugins/mod_http_files.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') 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("%.([^./]+)$"); -- cgit v1.2.3