Mercurial > prosody-hg
comparison plugins/mod_http_file_share.lua @ 11499:a8cbbbb1f165
mod_http_file_share: Fix logging of error opening file
It's annoying that Lua interpolates the filename into the error message.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 05 Apr 2021 16:23:59 +0200 |
| parents | 8bf632540197 |
| children | 21706a581b8a |
comparison
equal
deleted
inserted
replaced
| 11498:d61ec5e6ee16 | 11499:a8cbbbb1f165 |
|---|---|
| 340 return 304; | 340 return 304; |
| 341 end | 341 end |
| 342 local filename = get_filename(slot_id); | 342 local filename = get_filename(slot_id); |
| 343 local handle, ferr = io.open(filename); | 343 local handle, ferr = io.open(filename); |
| 344 if not handle then | 344 if not handle then |
| 345 module:log("error", "Could not open file: %s", filename, ferr); | 345 module:log("error", "Could not open file for reading: %s", ferr); |
| 346 -- This can be because the upload slot wasn't used, or the file disappeared | 346 -- This can be because the upload slot wasn't used, or the file disappeared |
| 347 -- somehow, or permission issues. | 347 -- somehow, or permission issues. |
| 348 return 410; | 348 return 410; |
| 349 end | 349 end |
| 350 | 350 |
