Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2022-10-18 18:51:24 +0300
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-10-20 09:38:38 +0300
commit8706dc207f94cd9c963d4b6574970bbd946f4a4d (patch)
tree3ca2a022b899c77ffc574d18ba01741a291593e4
parent7711505d3951e0160588da2834233f8b68c84820 (diff)
Return proper status code if file is not found during writing
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--lib/Controller/WopiController.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Controller/WopiController.php b/lib/Controller/WopiController.php
index f21de4c7..c909fe38 100644
--- a/lib/Controller/WopiController.php
+++ b/lib/Controller/WopiController.php
@@ -544,6 +544,9 @@ class WopiController extends Controller {
$this->wopiMapper->update($wopi);
}
return new JSONResponse(['LastModifiedTime' => Helper::toISO8601($file->getMTime())]);
+ } catch (NotFoundException $e) {
+ $this->logger->logException($e, ['level' => ILogger::INFO, 'app' => 'richdocuments', 'message' => 'File not found']);
+ return new JSONResponse([], Http::STATUS_NOT_FOUND);
} catch (\Exception $e) {
$this->logger->logException($e, ['level' => ILogger::ERROR, 'app' => 'richdocuments', 'message' => 'getFile failed']);
return new JSONResponse([], Http::STATUS_INTERNAL_SERVER_ERROR);