-2

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

Ganesh
  • 25
  • 6
  • No. There is not. By definition, redirects have a status code of 3xx. Basic http stuff. – Cerad Sep 11 '17 at 14:41

2 Answers2

1

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

throw new \Exception();
Michał Szczech
  • 466
  • 4
  • 17
0

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.

Mat.eo
  • 31
  • 1
  • 8