1

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 ?

Clément Andraud
  • 9,103
  • 25
  • 80
  • 158

1 Answers1

2

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

K-Phoen
  • 1,260
  • 9
  • 18