mod_http_file_share: Log error opening file for writing
util.error.coerce() doesn't work well with iolib
--- a/plugins/mod_http_file_share.lua Mon Apr 05 16:23:59 2021 +0200
+++ b/plugins/mod_http_file_share.lua Mon Apr 05 16:24:39 2021 +0200
@@ -245,9 +245,10 @@
if not request.body_sink then
module:log("debug", "Preparing to receive upload into %q, expecting %s", filename, B(upload_info.filesize));
- local fh, err = errors.coerce(io.open(filename.."~", "w"));
+ local fh, err = io.open(filename.."~", "w");
if not fh then
- return err;
+ module:log("error", "Could not open file for writing: %s", err);
+ return 500;
end
request.body_sink = fh;
if request.body == false then