Loading
Issue #3630200: Download route answers with a 500 error instead of 404 when the file is missing on disk
OnlyofficeDownloadController::download() now checks that the file exists on disk before it builds the BinaryFileResponse. A missing file gets the route's JSON error with status 404 and an error in the log, the same as a missing file entity, instead of an uncaught FileNotFoundException and a 500 error page.
Tested with a kernel test (not part of the MR, the module has no test suite) that calls the controller with a valid link key. For an existing file it returns a BinaryFileResponse. For a file entity whose file is missing it returns 404 with error: 1; on 3.0.x the same call throws FileNotFoundException. php -l passes.
Issue: https://www.drupal.org/i/3630200
Text generated with AI