Open koroan opened 2 years ago
@weierophinney you may have better insight here?
First, is the controller listed in the api-tools-api-problem.render_error_controllers
configuration key? (see https://api-tools.getlaminas.org/documentation/modules/api-tools-api-problem#key-render_error_controllers)
Second, have you tried returning an ApiProblemResponse
from your controller instead of throwing the exception? The documentation I linked demonstrates that, and it's an alternative to throwing the exception.
Bug Report
Summary
I want to throw exception inside Rpc controller, like this:
And I got an exception in html format (/module/Application/view/error/index.phtml works), but I was expecting response in JSON, like this:
Of course I have header Content-Type: application/json What I do incorrect? How can I get exception in Json format?