diff options
author | Robin Appelman <robin@icewind.nl> | 2018-02-07 13:34:30 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2018-02-07 14:44:32 +0100 |
commit | dbc99e47efa13528c65585476fad7da16d757aea (patch) | |
tree | 632bbb73c320e4ac265e9b594ff9c8f63870496f | |
parent | e2fddd29d156cc552a1d33e2c70f26e1b9c1a576 (diff) | |
download | nextcloud-server-dbc99e47efa13528c65585476fad7da16d757aea.tar.gz nextcloud-server-dbc99e47efa13528c65585476fad7da16d757aea.zip |
keep previous exception when transforming to dav exception
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Directory.php | 6 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php index cb5a2ab8123..da988164652 100644 --- a/apps/dav/lib/Connector/Sabre/Directory.php +++ b/apps/dav/lib/Connector/Sabre/Directory.php @@ -150,11 +150,11 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node $node->acquireLock(ILockingProvider::LOCK_SHARED); return $node->put($data); } catch (\OCP\Files\StorageNotAvailableException $e) { - throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage()); + throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage(), $e->getCode(), $e); } catch (InvalidPathException $ex) { - throw new InvalidPath($ex->getMessage()); + throw new InvalidPath($ex->getMessage(), false, $ex); } catch (ForbiddenException $ex) { - throw new Forbidden($ex->getMessage(), $ex->getRetry()); + throw new Forbidden($ex->getMessage(), $ex->getRetry(), $ex); } catch (LockedException $e) { throw new FileLocked($e->getMessage(), $e->getCode(), $e); } diff --git a/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php b/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php index 9d60b227612..346e21adc9d 100644 --- a/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php +++ b/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php @@ -36,9 +36,10 @@ class InvalidPath extends Exception { /** * @param string $message * @param bool $retry + * @param \Exception|null $previous */ - public function __construct($message, $retry = false) { - parent::__construct($message); + public function __construct($message, $retry = false, \Exception $previous = null) { + parent::__construct($message, 0, $previous); $this->retry = $retry; } |