kkreft
2/11/2016 - 3:25 PM

source: http://stackoverflow.com/questions/21932229/how-can-i-throw-a-403-exception-in-symfony2

use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
..

throw new AccessDeniedHttpException($this->get('translator')->trans('ERROR.ACCESS_DENIED'));