Skip to content

Commit

Permalink
fix: make locked exception path relative to the view
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 authored and backportbot[bot] committed Feb 11, 2025
1 parent cb22b3f commit e813f3d
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions lib/private/Files/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -2062,9 +2062,9 @@ private function lockPath($path, $type, $lockMountPoint = false) {
);
}
} 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()
);
Expand Down Expand Up @@ -2102,20 +2102,12 @@ public function changeLock($path, $type, $lockMountPoint = false) {
);
}
} 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;
Expand Down

0 comments on commit e813f3d

Please sign in to comment.