From 33fb176651657264e93cf787b23e6315be19848a Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 28 Jan 2025 20:25:28 +0100 Subject: [PATCH] fix: make locked exception path relative to the view Signed-off-by: Robin Appelman --- lib/private/Files/View.php | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 8521fc24d02..7e71d7099b3 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -2038,9 +2038,9 @@ class View { ); } } catch (LockedException $e) { - // rethrow with the a human-readable path + // rethrow with the human-readable path throw new LockedException( - $this->getPathRelativeToFiles($absolutePath), + $path, $e, $e->getExistingLock() ); @@ -2078,20 +2078,12 @@ class View { ); } } catch (LockedException $e) { - try { - // rethrow with the a human-readable path - throw new LockedException( - $this->getPathRelativeToFiles($absolutePath), - $e, - $e->getExistingLock() - ); - } catch (\InvalidArgumentException $ex) { - throw new LockedException( - $absolutePath, - $ex, - $e->getExistingLock() - ); - } + // rethrow with the a human-readable path + throw new LockedException( + $path, + $e, + $e->getExistingLock() + ); } return true;