Symfony 2. How to catch Exception parameter in Twig template?

Viewed 4271

I'm throwing some exception in my controller.

For example:

throw new AccessDeniedHttpException('some_text');

How can i catch it's 'some_text' parameter in my Twig template?

I found the {{ status_code }} and {{ status_text }} variables, but can't find something similar that solve my problem.

P.S. I'm already use custom error page. I just want give users specific error explanations.

Thnx.

2 Answers
Related