|
38 | 38 | use Symfony\Component\Console\Application as ConsoleApplication;
|
39 | 39 | use Symfony\Component\Console\Exception\CommandNotFoundException;
|
40 | 40 | use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
|
41 |
| -use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException; |
| 41 | +use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface; |
42 | 42 | use Symfony\Component\HttpFoundation\RedirectResponse as SymfonyRedirectResponse;
|
43 | 43 | use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
|
44 | 44 | use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
| 45 | +use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; |
45 | 46 | use Symfony\Component\HttpKernel\Exception\HttpException;
|
46 | 47 | use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
47 | 48 | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
@@ -143,7 +144,7 @@ class Handler implements ExceptionHandlerContract
|
143 | 144 | ModelNotFoundException::class,
|
144 | 145 | MultipleRecordsFoundException::class,
|
145 | 146 | RecordsNotFoundException::class,
|
146 |
| - SuspiciousOperationException::class, |
| 147 | + RequestExceptionInterface::class, |
147 | 148 | TokenMismatchException::class,
|
148 | 149 | ValidationException::class,
|
149 | 150 | ];
|
@@ -630,7 +631,7 @@ protected function prepareException(Throwable $e)
|
630 | 631 | ),
|
631 | 632 | $e instanceof AuthorizationException && ! $e->hasStatus() => new AccessDeniedHttpException($e->getMessage(), $e),
|
632 | 633 | $e instanceof TokenMismatchException => new HttpException(419, $e->getMessage(), $e),
|
633 |
| - $e instanceof SuspiciousOperationException => new NotFoundHttpException('Bad hostname provided.', $e), |
| 634 | + $e instanceof RequestExceptionInterface => new BadRequestHttpException('Bad request.', $e), |
634 | 635 | $e instanceof RecordsNotFoundException => new NotFoundHttpException('Not found.', $e),
|
635 | 636 | default => $e,
|
636 | 637 | };
|
|
0 commit comments