# HG changeset patch # User Kim Alvefur # Date 1617632679 -7200 # Node ID 21706a581b8a180ca851c228374b541c84a1102c # Parent a8cbbbb1f1654877982e256cf85f9172a500a18f mod_http_file_share: Log error opening file for writing util.error.coerce() doesn't work well with iolib diff -r a8cbbbb1f165 -r 21706a581b8a plugins/mod_http_file_share.lua --- 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