Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After throwing an Exception, I get X-Debug-Exception in headers... #2261

Open
marcu87 opened this issue Aug 20, 2020 · 4 comments
Open

After throwing an Exception, I get X-Debug-Exception in headers... #2261

marcu87 opened this issue Aug 20, 2020 · 4 comments

Comments

@marcu87
Copy link

marcu87 commented Aug 20, 2020

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.

Here an screenshot of the response.

Anyone knows how to avoid this behaviour?
Thanks!

@xabbuh
Copy link
Member

xabbuh commented Aug 20, 2020

These headers are added by the SerializerErrorRenderer when the debug mode is enabled.

@Willdogx
Copy link

These headers are added by the SerializerErrorRenderer when the debug mode is enabled.

How do you disable the debug mode?

@yceruto
Copy link
Contributor

yceruto commented Aug 20, 2020

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.

@xabbuh
Copy link
Member

xabbuh commented Aug 21, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants