Created
June 14, 2012 11:52
-
-
Save coreymcmahon/2929838 to your computer and use it in GitHub Desktop.
Example of an Exception Controller that responds to exception events in our framework - http://www.symfonycentral.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Calendar\Controller; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\HttpKernel\Exception\FlattenException; | |
class ErrorController | |
{ | |
public function exceptionAction(FlattenException $exception) | |
{ | |
$msg = 'Something went wrong! ('.$exception->getMessage().')'; | |
return new Response($msg, $exception->getStatusCode()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment