Skip to content
Snippets Groups Projects
Commit 24f0151f authored by Robin Appelman's avatar Robin Appelman
Browse files

handle locked exceptions when getting file/directory info in sabre

parent a89bb1d3
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,7 @@ namespace OC\Connector\Sabre; ...@@ -30,6 +30,7 @@ namespace OC\Connector\Sabre;
use OC\Connector\Sabre\Exception\InvalidPath; use OC\Connector\Sabre\Exception\InvalidPath;
use OC\Connector\Sabre\Exception\FileLocked; use OC\Connector\Sabre\Exception\FileLocked;
use OCP\Lock\LockedException; use OCP\Lock\LockedException;
use Sabre\DAV\Exception\Locked;
class Directory extends \OC\Connector\Sabre\Node class Directory extends \OC\Connector\Sabre\Node
implements \Sabre\DAV\ICollection, \Sabre\DAV\IQuota { implements \Sabre\DAV\ICollection, \Sabre\DAV\IQuota {
...@@ -191,7 +192,11 @@ class Directory extends \OC\Connector\Sabre\Node ...@@ -191,7 +192,11 @@ class Directory extends \OC\Connector\Sabre\Node
if (!is_null($this->dirContent)) { if (!is_null($this->dirContent)) {
return $this->dirContent; return $this->dirContent;
} }
try {
$folderContent = $this->fileView->getDirectoryContent($this->path); $folderContent = $this->fileView->getDirectoryContent($this->path);
} catch (LockedException $e) {
throw new Locked();
}
$nodes = array(); $nodes = array();
foreach ($folderContent as $info) { foreach ($folderContent as $info) {
......
...@@ -150,6 +150,8 @@ class ObjectTree extends \Sabre\DAV\Tree { ...@@ -150,6 +150,8 @@ class ObjectTree extends \Sabre\DAV\Tree {
throw new \Sabre\DAV\Exception\ServiceUnavailable('Storage not available'); throw new \Sabre\DAV\Exception\ServiceUnavailable('Storage not available');
} catch (StorageInvalidException $e) { } catch (StorageInvalidException $e) {
throw new \Sabre\DAV\Exception\NotFound('Storage ' . $path . ' is invalid'); throw new \Sabre\DAV\Exception\NotFound('Storage ' . $path . ' is invalid');
} catch (LockedException $e) {
throw new \Sabre\DAV\Exception\Locked();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment