public function onKernelException(GetResponseForExceptionEvent $event) {

        $ex = $event->getException();

        // Handle the exception.
        if (true === ($ex instanceof BadUserRoleException)) {
            $this->handleBadUserRoleException($event, $ex);
        }
        if (true === ($ex instanceof RedirectResponseException)) {
            $this->handleRedirectResponseException($event, $ex);
        }

        return $event;
    }
public function onKernelException(GetResponseForExceptionEvent $event) {

        $ex = $event->getException();

        // Handle the exception.
        if (true === ($ex instanceof BadUserRoleException)) {
            $this->handleBadUserRoleException($event, $ex);
        }
        if (true === ($ex instanceof RedirectResponseException)) {
            $this->handleRedirectResponseException($event, $ex);
        }

        return $event;
    }
public function onKernelException ( GetResponseForExceptionEvent $ event ) { $ ex = $ event -> getException ( ) ; // Handle the exception. if ( true === ( $ ex instanceof BadUserRoleException ) ) { $ this -> handleBadUserRoleException ( $ event , $ ex ) ; } if ( true === ( $ ex instanceof RedirectResponseException ) ) { $ this -> handleRedirectResponseException ( $ event , $ ex ) ; } return $ event ; }
On kernel exception.

@param GetResponseForExceptionEvent $event The event.
@return GetResponseForExceptionEvent Returns the event.
On kernel exception .