From 78e713a8ce7c66f556eccc0a10bb821a472fcc51 Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Fri, 26 Jun 2026 10:15:19 +0300 Subject: [PATCH] handle invalid pdf params --- backend/app/Element/UseCases/GetElementPdf/GetElementPdf.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app/Element/UseCases/GetElementPdf/GetElementPdf.php b/backend/app/Element/UseCases/GetElementPdf/GetElementPdf.php index e210c61..cfce117 100644 --- a/backend/app/Element/UseCases/GetElementPdf/GetElementPdf.php +++ b/backend/app/Element/UseCases/GetElementPdf/GetElementPdf.php @@ -31,11 +31,11 @@ class GetElementPdf } if (!$this->isAllowedPdfFolder($request->folder)) { - throw new NotFoundException('PDF not found'); + throw new BadRequestException('folder is invalid'); } if (!$this->isValidPdfFileName($request->fileName)) { - throw new NotFoundException('PDF not found'); + throw new BadRequestException('fileName is invalid'); } $path = "element-pdfs/$request->folder/$request->fileName";