Skip to content

Commit 8aa24a8

Browse files
icewind1991kesselb
authored andcommitted
fix: make locked exception path relative to the view
Signed-off-by: Robin Appelman <[email protected]>
1 parent 0af2d28 commit 8aa24a8

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

lib/private/Files/View.php

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,9 +2062,9 @@ private function lockPath($path, $type, $lockMountPoint = false) {
20622062
);
20632063
}
20642064
} catch (LockedException $e) {
2065-
// rethrow with the a human-readable path
2065+
// rethrow with the human-readable path
20662066
throw new LockedException(
2067-
$this->getPathRelativeToFiles($absolutePath),
2067+
$path,
20682068
$e,
20692069
$e->getExistingLock()
20702070
);
@@ -2102,20 +2102,12 @@ public function changeLock($path, $type, $lockMountPoint = false) {
21022102
);
21032103
}
21042104
} catch (LockedException $e) {
2105-
try {
2106-
// rethrow with the a human-readable path
2107-
throw new LockedException(
2108-
$this->getPathRelativeToFiles($absolutePath),
2109-
$e,
2110-
$e->getExistingLock()
2111-
);
2112-
} catch (\InvalidArgumentException $ex) {
2113-
throw new LockedException(
2114-
$absolutePath,
2115-
$ex,
2116-
$e->getExistingLock()
2117-
);
2118-
}
2105+
// rethrow with the a human-readable path
2106+
throw new LockedException(
2107+
$path,
2108+
$e,
2109+
$e->getExistingLock()
2110+
);
21192111
}
21202112

21212113
return true;

0 commit comments

Comments
 (0)