Changeset

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
parents 5259:c85c348253bd
children 5261:b14f02671439
files plugins/mod_http_files.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
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("%.([^./]+)$");