Commit eb894e66 authored by Vincent Petry's avatar Vincent Petry
Browse files

Soft fail in CustomPropertiesBackend whenever storage not available

When a storage is not available, it will not fail the whole call any
more but still return a usable file list.
parent a9b4f0d8
......@@ -30,6 +30,7 @@ use Sabre\DAV\PropFind;
use Sabre\DAV\PropPatch;
use Sabre\DAV\Tree;
use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\Exception\ServiceUnavailable;
class CustomPropertiesBackend implements BackendInterface {
......@@ -100,6 +101,9 @@ class CustomPropertiesBackend implements BackendInterface {
if (!($node instanceof Node)) {
} catch (ServiceUnavailable $e) {
// might happen for unavailable mount points, skip
} 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
......@@ -105,11 +105,16 @@ class CustomPropertiesBackend extends \Test\TestCase {
* Test that propFind on a missing file soft fails
public function testPropFindMissingFileSoftFail() {
->will($this->throwException(new \Sabre\DAV\Exception\NotFound()));
->will($this->throwException(new \Sabre\DAV\Exception\ServiceUnavailable()));
$propFind = new \Sabre\DAV\PropFind(
......@@ -125,6 +130,11 @@ class CustomPropertiesBackend extends \Test\TestCase {
// no exception, soft fail
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment