updated exception handling for Symfony 2.5