Symfony redirect with response

603 views Asked by At

i would like to know is there anyway to return from controller an 500 exceptional error. i need to return with response, code and redirection.Please help me out of it

2

There are 2 answers

1
Mat.eo On

I don`t have idea for what you can need that, but when you return $this->render and path that does not exist , symfony returns 500.

0
Michał Szczech On

If you want to return "500 Internal Server Error" just throw an exception, for example:

throw new \Exception();