fix: Wrap filesystem LockedExceptions for holding the readable path

Signed-off-by: Julius Härtl <jus@bitgrid.net>
pull/37621/head
Julius Härtl 2023-03-28 13:19:05 +07:00
parent c995428431
commit 11c5bc6a2a
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 3 additions and 0 deletions

@ -764,6 +764,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
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]);
}
@ -796,6 +797,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
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]);
}
@ -828,6 +830,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
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]);
}