Skip to content
Snippets Groups Projects
Unverified Commit 9d6d23d1 authored by Robin Appelman's avatar Robin Appelman
Browse files

keep previous exception when transforming to dav exception


Signed-off-by: default avatarRobin Appelman <robin@icewind.nl>
parent 3063131e
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment