aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-04-05 16:24:39 +0200
committerKim Alvefur <zash@zash.se>2021-04-05 16:24:39 +0200
commitf7131f81f25b7407a0c31a337305306b615fe33f (patch)
treee9d3883178a3e7d892c688894534163e67a77248 /plugins
parentde641f6e24df2f835f17f62c40bd0e29f269d1bb (diff)
downloadprosody-f7131f81f25b7407a0c31a337305306b615fe33f.tar.gz
prosody-f7131f81f25b7407a0c31a337305306b615fe33f.zip
mod_http_file_share: Log error opening file for writing
util.error.coerce() doesn't work well with iolib
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_http_file_share.lua5
1 files 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