Skip to content

Commit

Permalink
Simplify exception logical condition
Browse files Browse the repository at this point in the history
When rendering the custom exception page, we test if the
MissingRequiredAttributeException. But it also had to be a HTTP
exception. That was never the case (also before #313).

By removing the first part of the statement, the error message is
displayed correctly once again.
  • Loading branch information
MKodde committed Mar 11, 2024
1 parent 9da4adc commit 5317844
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use Throwable;
use Surfnet\StepupBundle\Controller\ExceptionController as BaseExceptionController;
use Surfnet\StepupSelfService\SelfServiceBundle\Exception\MissingRequiredAttributeException;
use Symfony\Component\HttpKernel\Exception\HttpException;

final class ExceptionController extends BaseExceptionController
{
Expand All @@ -39,7 +38,7 @@ protected function getPageTitleAndDescription(Throwable $exception): array
{
$translator = $this->getTranslator();

if ($exception instanceof HttpException && $exception instanceof MissingRequiredAttributeException) {
if ($exception instanceof MissingRequiredAttributeException) {
$title = $translator->trans('stepup.error.missing_required_attribute.title');
$description = $exception->getMessage();
}
Expand Down

0 comments on commit 5317844

Please sign in to comment.