FOSRestBundle
FOSRestBundle copied to clipboard
After throwing an Exception, I get X-Debug-Exception in headers...
Hi there,
I'm using version 3.0 (I also tried with 3.0.2 and had the same problem);
I added in my code a throw new \Exception();
and in the Response Headers it adds the X-Debug-Exception
and X-Debug-Exception-File
.
Anyone knows how to avoid this behaviour? Thanks!
These headers are added by the SerializerErrorRenderer
when the debug mode is enabled.
These headers are added by the
SerializerErrorRenderer
when the debug mode is enabled.
How do you disable the debug mode?
How do you disable the debug mode?
Removing Debug::enable();
statement from your front file (index.php).
However, this is only done for dev environment, for production it's not called by default.
You can either set the showException
in the current request to false
or disable the debug flag in the kernel. Note that by default the additional header are only sent in the dev
environment but not in prod
.