summaryrefslogtreecommitdiffstats
path: root/lib/private/connector/sabre
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-03-18 12:30:23 +0100
committerVincent Petry <pvince81@owncloud.com>2015-03-18 12:36:37 +0100
commit50194c31b42399cd27d178cccfc58a21f57f778c (patch)
tree45d92061b48d73ad1d1b0a573f51cd1a5b8ec6d7 /lib/private/connector/sabre
parent093efa458c16ea4a7f7fcaf3f98e1e0fb96624c4 (diff)
downloadnextcloud-server-50194c31b42399cd27d178cccfc58a21f57f778c.tar.gz
nextcloud-server-50194c31b42399cd27d178cccfc58a21f57f778c.zip
Soft fail in custom properties backend
This makes it possible for clients to still receive a file list (minus the broken files) instead of getting no list at all
Diffstat (limited to 'lib/private/connector/sabre')
-rw-r--r--lib/private/connector/sabre/custompropertiesbackend.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/private/connector/sabre/custompropertiesbackend.php b/lib/private/connector/sabre/custompropertiesbackend.php
index 76ac8b84ef9..6827cb9ae0d 100644
--- a/lib/private/connector/sabre/custompropertiesbackend.php
+++ b/lib/private/connector/sabre/custompropertiesbackend.php
@@ -29,6 +29,7 @@ use Sabre\DAV\PropertyStorage\Backend\BackendInterface;
use Sabre\DAV\PropFind;
use Sabre\DAV\PropPatch;
use Sabre\DAV\Tree;
+use Sabre\DAV\Exception\NotFound;
class CustomPropertiesBackend implements BackendInterface {
@@ -94,8 +95,19 @@ class CustomPropertiesBackend implements BackendInterface {
* @return void
*/
public function propFind($path, PropFind $propFind) {
- $node = $this->tree->getNodeForPath($path);
- if (!($node instanceof Node)) {
+ try {
+ $node = $this->tree->getNodeForPath($path);
+ if (!($node instanceof Node)) {
+ return;
+ }
+ } catch (NotFound $e) {
+ // in some rare (buggy) cases the node might not be found,
+ // we catch the exception to prevent breaking the whole list with a 404
+ // (soft fail)
+ \OC::$server->getLogger()->warning(
+ 'Could not get node for path: \"' . $path . '\" : ' . $e->getMessage(),
+ array('app' => 'files')
+ );
return;
}