dotkernel / api

DotKernel's PSR-7 REST style API built around the Mezzio API skeleton.
https://docs.dotkernel.org/api-documentation/
MIT License
38 stars 5 forks source link

Twig turns exceptions into error pages. #2

Closed alexmerlin closed 5 years ago

alexmerlin commented 5 years ago

Since Twig has been implemented, when the API encounters an exception it parses the error via an error document and the JSON response header is missing. It should log the error in the error log (this part is already happening correctly), return 500 Internal server error as before (and - if running in development mode - output the error details directly w/o parsing them in a template).

alexmerlin commented 5 years ago

When an exception is triggered, the API now returns the correct response.