diff options
author | Robin Appelman <robin@icewind.nl> | 2020-03-02 17:47:48 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2020-03-02 19:29:44 +0100 |
commit | fab22ac14cb8116006b11cb2bcfe0337daaa2138 (patch) | |
tree | cbee43b264dbd6c783b6be75b4a401c5922c2350 /lib/public | |
parent | 64a29d01a492db19289833ba9f485b7dca881cef (diff) | |
download | nextcloud-server-fab22ac14cb8116006b11cb2bcfe0337daaa2138.tar.gz nextcloud-server-fab22ac14cb8116006b11cb2bcfe0337daaa2138.zip |
pass the existing locks info when making locked exception with absolute paths
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/Lock/LockedException.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/public/Lock/LockedException.php b/lib/public/Lock/LockedException.php index 99205b54d24..582157010cc 100644 --- a/lib/public/Lock/LockedException.php +++ b/lib/public/Lock/LockedException.php @@ -44,6 +44,9 @@ class LockedException extends \Exception { */ private $path; + /** @var string|null */ + private $existingLock; + /** * LockedException constructor. * @@ -54,6 +57,7 @@ class LockedException extends \Exception { */ public function __construct(string $path, \Exception $previous = null, string $existingLock = null) { $message = '"' . $path . '" is locked'; + $this->existingLock = $existingLock; if ($existingLock) { $message .= ', existing lock on file: ' . $existingLock; } @@ -68,4 +72,12 @@ class LockedException extends \Exception { public function getPath(): string { return $this->path; } + + /** + * @return string + * @since 19.0.0 + */ + public function getExistingLock(): ?string { + return $this->existingLock; + } } |