php - FOSRestBundle: show my custom exception message -


I am trying to add a custom control of exceptions in FOSRestBundle, but it is ignoring my custom messages ( This situation's code response is fine).

I have:

  New HTTP Exception (404, "User {$ ID} not found");  

But get this Jason response:

  {"error": {"code": 404, "message": "did not get"}}  

So I do not get a way to show my custom message

You can also add exceptions to the following configurations:

  fos_rest: exception: code: 'my \ custom \ notfound \ exceptioncase404': 404 Message: 'My custom' \ NotFound \ exception 404 ': Correct  

Provide a custom message in your exception class And it should work as expected.


Comments

Popular posts from this blog

c++ - C/pp Sockets, recv()/send() works only under gdb -

GO: Serve static pages -

objective c - How to open front/back camera at the same time in iOS developing? -