Clément Andraud
Clément Andraud

Reputation: 9279

Symfony, Exception message in production

I'm working on a RestApi with Symfony2 and https://github.com/FriendsOfSymfony/FOSRestBundle

I log all errors, and i send exception if there is a problem.

For example :

throw new AccessDeniedException("This is a message for my error");

When i am on dev mode, i can retrieve my message This is a message for my error in the response, but in production mode, i only have {"error":{"code":403,"message":"Forbidden"}}

How can i edit the message in this error in production mode ?

Upvotes: 1

Views: 1183

Answers (1)

K-Phoen
K-Phoen

Reputation: 1270

The ExceptionController-related options might interest you. Did you read this page?

Upvotes: 2

Related Questions