frapi/frapi — pull request #99 by dshafik (2012-02-17 16:47:25+00:00)
Title: Don't try to use the controller outside of the try

If an error occurs trying to instantiate the controller during error handling, it is thrown as an exception and we skip to the `catch`, leaving the `$controller` var is undefined. Currently it then still tries to use `$controller` resulting in a fatal error.

To resolve this we move the use of `$controller` into the `try` block and because we can't handle the formatted output, we send a format-agnostic HTTP 500 error with no body in the `catch`.