diff --git a/src/Controller/File/UploadController.php b/src/Controller/File/UploadController.php index 0888ba1..05402c5 100755 --- a/src/Controller/File/UploadController.php +++ b/src/Controller/File/UploadController.php @@ -7,6 +7,7 @@ use App\Entity\User; use App\Repository\UserRepository; use DateTimeImmutable; use Doctrine\ORM\EntityManagerInterface; +use Exception; use RuntimeException; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; @@ -59,7 +60,7 @@ class UploadController extends AbstractController $fileUrl = $this->generateFileUrl($newFilename); return new Response($fileUrl, Response::HTTP_CREATED); - } catch (\Exception $exception) { + } catch (Exception $exception) { return new JsonResponse(['error' => $exception->getMessage()], Response::HTTP_BAD_REQUEST); } }