Skip to content

Options to catch NotFoundHttpException #49307

Answered by kAlvaro
kAlvaro asked this question in Q&A
Discussion options

You must be logged in to vote

I've given up on the template (after all, it's the default Symfony one so I'm sure nobody in Business asked for it) and just generated a response in the subscriber to let Symfony know I handled it myself:

            $response = new Response('404 Not Found', headers: ['Content-Type' => 'text/plain']);
            $event->setResponse($response);

Per exception log level requires 5.4 so I'll have a look once we're able to upgrade.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@kAlvaro
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by kAlvaro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants