Closed arizanovj closed 1 year ago
Hi @arizanovj
Could you try to set DEBUG=false
env variable and check?
Maybe we can provide an option to select Yii or Whoops as default error handler?
Hi @arizanovj
Could you try to set
DEBUG=false
env variable and check?
Works this way, but I'll be using the handler to handle validation exceptions and return JSON responses. Is it possible to make it work with DEBUG=true ? My reasoning is that once the handler catches the exception it should not be propagated regardless of the DEBUG value.
Hi @arizanovj! Sorry for long response. Validation exceptions and debug mod are not related.
To handle filter validation exception you can use Spiral\Filter\ValidationHandlerMiddleware
and Spiral\Filters\ErrorsRendererInterface
https://spiral.dev/docs/filters-filter/3.5/en#handle-validation-errors
Here https://spiral.dev/docs/http-errors/3.5/en you can read about working with HTTP exceptions
Thanks for the explanation.
When you install the skeleton app and go to http://localhost:8080/exception the exception is not handled by App\Application\Service\ErrorHandler\ViewRenderer instead it displays the raw exception string.![image](https://user-images.githubusercontent.com/9591283/214918098-0c776593-5548-46cd-bce6-863ac12a595d.png)