src/Controller/ErrorJsonController.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Psr\Log\LoggerInterface;
  4. use Symfony\Component\HttpFoundation\JsonResponse;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. use Throwable;
  8. use App\Model\LogDataInFile;
  9. class ErrorJsonController extends AbstractController
  10. {
  11.     public function show(Throwable $exceptionLoggerInterface $logger):Response
  12.     {
  13.         dump($exception);die;
  14.         return $this->json(
  15.             [
  16.                 'status' => false,
  17.                 'error' => $exception->getMessage(),
  18.                 'file' => $exception->getFile(),
  19.                 'line' => $exception->getLine(),
  20. //                'object' => $exception->getPrevious()
  21.             ]
  22.         );
  23.     }
  24. }