Attempt to fix psalm false-positive

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2021-04-12 08:49:25 +02:00
parent 0f10e1f0e1
commit 6b6aef03f7
3 changed files with 7 additions and 4 deletions

View File

@@ -35,7 +35,7 @@ use OCP\IDBConnection;
use OCP\IL10N;
use OCP\IPreview;
use OCP\IRequest;
use OCP\Share;
use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IManager;
use OCP\Share\IShare;
@@ -140,9 +140,10 @@ class FilesAppService implements IAttachmentService, ICustomAttachmentService {
}
public function display(Attachment $attachment) {
/** @psalm-suppress InvalidCatch */
try {
$share = $this->shareProvider->getShareById($attachment->getId());
} catch (Share\Exceptions\ShareNotFound $e) {
} catch (ShareNotFound $e) {
throw new NotFoundException('File not found');
}
$file = $share->getNode();