Skip to content

Commit

Permalink
fix: Wrap filesystem LockedExceptions for holding the readable path
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed May 2, 2023
1 parent c995428 commit 11c5bc6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/private/Files/Storage/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ public function acquireLock($path, $type, ILockingProvider $provider) {
try {
$provider->acquireLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type, $this->getId() . '::' . $path);
} catch (LockedException $e) {
$e = new LockedException($e->getPath(), $e, $e->getExistingLock(), $path);
if ($logger) {
$logger->info($e->getMessage(), ['exception' => $e]);
}
Expand Down Expand Up @@ -796,6 +797,7 @@ public function releaseLock($path, $type, ILockingProvider $provider) {
try {
$provider->releaseLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type);
} catch (LockedException $e) {
$e = new LockedException($e->getPath(), $e, $e->getExistingLock(), $path);
if ($logger) {
$logger->info($e->getMessage(), ['exception' => $e]);
}
Expand Down Expand Up @@ -828,6 +830,7 @@ public function changeLock($path, $type, ILockingProvider $provider) {
try {
$provider->changeLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type);
} catch (LockedException $e) {
$e = new LockedException($e->getPath(), $e, $e->getExistingLock(), $path);
if ($logger) {
$logger->info($e->getMessage(), ['exception' => $e]);
}
Expand Down

0 comments on commit 11c5bc6

Please sign in to comment.