# HG changeset patch # User Kim Alvefur # Date 1616932266 -7200 # Node ID 77f2d45799edcd94e663c4665ddc77ff595561ab # Parent 6da8d9cb355d01d4a89df613e787f1122c8601a7 mod_http_file_share: Fix reporting of missing files This just gave an unhelpful 500 error. It would be nice to have some wrapper code that could untangle the embedded filename in the io libs errors. diff -r 6da8d9cb355d -r 77f2d45799ed plugins/mod_http_file_share.lua --- a/plugins/mod_http_file_share.lua Sun Mar 28 13:22:35 2021 +0200 +++ b/plugins/mod_http_file_share.lua Sun Mar 28 13:51:06 2021 +0200 @@ -339,9 +339,12 @@ return 304; end local filename = get_filename(slot_id); - local handle, ferr = errors.coerce(io.open(filename)); + local handle, ferr = io.open(filename); if not handle then - return ferr or 410; + module:log("error", "Could not open file: %s", filename, ferr); + -- This can be because the upload slot wasn't used, or the file disappeared + -- somehow, or permission issues. + return 410; end if not filetype then