From f7131f81f25b7407a0c31a337305306b615fe33f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 5 Apr 2021 16:24:39 +0200 Subject: mod_http_file_share: Log error opening file for writing util.error.coerce() doesn't work well with iolib --- plugins/mod_http_file_share.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/mod_http_file_share.lua b/plugins/mod_http_file_share.lua index 74c97a1b..60b26ff3 100644 --- a/plugins/mod_http_file_share.lua +++ b/plugins/mod_http_file_share.lua @@ -245,9 +245,10 @@ function handle_upload(event, path) -- PUT /upload/:slot 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 -- cgit v1.2.3