Skip to content

Commit

Permalink
Merge pull request #4318 from LibreSign/backport/4312/stable29
Browse files Browse the repository at this point in the history
[stable29] fix: show that file not found when validate file
  • Loading branch information
vitormattos authored Jan 15, 2025
2 parents e53453e + 00bb55d commit e4703fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Service/FileService.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ private function getFile(): \OCP\Files\File {
}
$fileToValidate = $this->root->getById($nodeId);
if (!count($fileToValidate)) {
throw new LibresignException($this->l10n->t('Invalid data to validate file'), 404);
throw new LibresignException($this->l10n->t('File not found'), 404);
}
/** @var \OCP\Files\File */
return current($fileToValidate);
Expand All @@ -276,6 +276,8 @@ private function getFileContent(): string {
} elseif ($this->file) {
try {
return $this->fileContent = $this->getFile()->getContent();
} catch (LibresignException $e) {
throw new LibresignException($e->getMessage(), 404);
} catch (\Throwable $th) {
throw new LibresignException($this->l10n->t('Invalid data to validate file'), 404);
}
Expand Down

0 comments on commit e4703fb

Please sign in to comment.