Software /
code /
prosody
Changeset
11500:21706a581b8a
mod_http_file_share: Log error opening file for writing
util.error.coerce() doesn't work well with iolib
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 05 Apr 2021 16:24:39 +0200 |
parents | 11499:a8cbbbb1f165 |
children | 11501:2c9db2278fed |
files | plugins/mod_http_file_share.lua |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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