From 0d9ad1416571b1e73f590b784dbd7320e75bb0cb Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 2 Jul 2015 10:47:54 +0200 Subject: Properly handle NotPermittedException in SabreDAV --- lib/private/connector/sabre/file.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php index e57d04f9a6e..0831bb374d5 100644 --- a/lib/private/connector/sabre/file.php +++ b/lib/private/connector/sabre/file.php @@ -142,6 +142,10 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\ throw new \Sabre\DAV\Exception('Could not rename part file to final file'); } } + catch (\OCP\Files\NotPermittedException $e) { + // a more general case - due to whatever reason the content could not be written + throw new \Sabre\DAV\Exception\Forbidden($e->getMessage(), $e->getCode(), $e); + } catch (\OCP\Files\LockNotAcquiredException $e) { // the file is currently being written to by another process throw new OC_Connector_Sabre_Exception_FileLocked($e->getMessage(), $e->getCode(), $e); -- cgit v1.2.3