summaryrefslogtreecommitdiff
path: root/lib/Kolab/DAV/File.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2015-03-13 11:45:39 (GMT)
committerAleksander Machniak <alec@alec.pl>2015-03-13 11:45:39 (GMT)
commitc4f78d07721b0c956be91387fb1dffccb351d1c1 (patch)
treeecf902c41e5ea904718ca3fceb7ee59940f5751e /lib/Kolab/DAV/File.php
parentaa428fdbdb669692d921a6b5aef5fba81d4b3844 (diff)
downloadiRony-c4f78d07721b0c956be91387fb1dffccb351d1c1.tar.gz
WebDAV: Check for storage errors and throw the according exceptions (#4406)
Diffstat (limited to 'lib/Kolab/DAV/File.php')
-rw-r--r--lib/Kolab/DAV/File.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Kolab/DAV/File.php b/lib/Kolab/DAV/File.php
index 8e402c4..b7e0b20 100644
--- a/lib/Kolab/DAV/File.php
+++ b/lib/Kolab/DAV/File.php
@@ -23,7 +23,6 @@
namespace Kolab\DAV;
-use \rcube;
use \Exception;
use \DateTime;
@@ -51,6 +50,7 @@ class File extends Node implements \Sabre\DAV\IFile, \Sabre\DAV\IProperties
* return an ETag, and just return null.
*
* @param resource $data
+ * @throws Sabre\DAV\Exception
* @return string|null
*/
public function put($data)
@@ -61,13 +61,14 @@ class File extends Node implements \Sabre\DAV\IFile, \Sabre\DAV\IProperties
$this->backend->file_update($this->path, $filedata);
}
catch (Exception $e) {
-// throw new \Sabre\DAV\Exception\Forbidden($e->getMessage());
+ $this->throw_exception($e);
}
try {
$this->data = $this->backend->file_info($this->path);
}
catch (Exception $e) {
+ $this->throw_exception($e);
}
return $this->getETag();
@@ -78,6 +79,7 @@ class File extends Node implements \Sabre\DAV\IFile, \Sabre\DAV\IProperties
*
* This method may either return a string or a readable stream resource
*
+ * @throws Sabre\DAV\Exception
* @return mixed
*/
public function get()
@@ -88,7 +90,7 @@ class File extends Node implements \Sabre\DAV\IFile, \Sabre\DAV\IProperties
rewind($fp);
}
catch (Exception $e) {
-// throw new \Sabre\DAV\Exception\Forbidden($e->getMessage());
+ $this->throw_exception($e);
}
return $fp;
@@ -97,6 +99,7 @@ class File extends Node implements \Sabre\DAV\IFile, \Sabre\DAV\IProperties
/**
* Delete the current file
*
+ * @throws Sabre\DAV\Exception
* @return void
*/
public function delete()
@@ -105,7 +108,7 @@ class File extends Node implements \Sabre\DAV\IFile, \Sabre\DAV\IProperties
$this->backend->file_delete($this->path);
}
catch (Exception $e) {
-// throw new \Sabre\DAV\Exception\Forbidden($e->getMessage());
+ $this->throw_exception($e);
}
// reset cache