M
M
MasterCopipaster2020-05-26 13:51:16
symfony
MasterCopipaster, 2020-05-26 13:51:16

Why don't error pages work in Symfony 4?

Hello everyone, I've come across this strange thing.
Symfony 4.4.8
Did everything according to the instructions as here
In an attempt to make beautiful error pages for my site.
I go to localhost / _error / 404 I see the page everything is OK (in dev) I
switch env to prod
I go to the controller that generates an error I divide it like this

if(!$entity){
                throw new HttpException(Response::HTTP_GONE, $this->failure_messages);
            }

As a result, the place of a beautiful page I see a standard bullshit with tracing
5eccf37f48692747985055.png
The response code is correct! and text too! but why in the prod environment is shown with a page with a bunch of secure information???!?!?
In this case, all templates are set as in the official instructions!
5eccf4067741a692405368.png
Who knows how to deal with this, I have already broken my whole brain!
As far as I know, the trace page should only be shown in the dev environment.
Could this be due to the fact that I'm using the built-in dev server?
bin/consoleserver:start

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question