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
committerJulius Härtl <jus@bitgrid.net>2022-10-18 18:51:24 +0300
commit9bf4297d62b3b791648b7a1590ec32bc6d5205f4 (patch)
tree4ee5f092bc412b57c9493cedcfbbba0c36bebe26
parentd2d2bb996e933154a7dd506203e1be3eb5404c09 (diff)
Return proper status code if file is not found during writingbugfix/2090
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 14d4d721..60d75054 100644
--- a/lib/Controller/WopiController.php
+++ b/lib/Controller/WopiController.php
@@ -567,6 +567,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);