try {
$this->acquireLock(ILockingProvider::LOCK_EXCLUSIVE);
- } catch (LockedException $e) {
+ } catch (LockedException $ex) {
if ($needsPartFile) {
$partStorage->unlink($internalPartPath);
}
// rethrow with the a human-readable path
throw new LockedException(
$this->getPathRelativeToFiles($absolutePath),
- $e
+ $e,
+ $e->getExistingLock()
);
}
}
// rethrow with the a human-readable path
throw new LockedException(
$this->getPathRelativeToFiles($absolutePath),
- $e
+ $e,
+ $e->getExistingLock()
);
- } catch (\InvalidArgumentException $e) {
+ } catch (\InvalidArgumentException $ex) {
throw new LockedException(
$absolutePath,
- $e
+ $ex,
+ $e->getExistingLock()
);
}
}
*/
private $path;
+ /** @var string|null */
+ private $existingLock;
+
/**
* LockedException constructor.
*
*/
public function __construct(string $path, \Exception $previous = null, string $existingLock = null) {
$message = '"' . $path . '" is locked';
+ $this->existingLock = $existingLock;
if ($existingLock) {
$message .= ', existing lock on file: ' . $existingLock;
}
public function getPath(): string {
return $this->path;
}
+
+ /**
+ * @return string
+ * @since 19.0.0
+ */
+ public function getExistingLock(): ?string {
+ return $this->existingLock;
+ }
}