Closed blasvicco closed 6 years ago
In here Sentry is just looking for the property statusCode but if the exception is triggered from the twig file like
statusCode
{% exit 404 %}
Then the exception that arrive to the event hook is Twig_Error_Runtime that has not a statusCode property.
Twig_Error_Runtime
Suggestion is look for the Twig_Error_Runtime->getPrevious() to get the proper yii\web\HttpException that is the one that has the statusCode property.
Twig_Error_Runtime->getPrevious()
yii\web\HttpException
@lukeyouell Any thoughts on this? Just playing around with setting up sentry on a craft project and seems like a large source of potential errors that we'd miss if the twig stuff isn't picked up.
Thanks!
In here Sentry is just looking for the property
statusCode
but if the exception is triggered from the twig file likeThen the exception that arrive to the event hook is
Twig_Error_Runtime
that has not astatusCode
property.Suggestion is look for the
Twig_Error_Runtime->getPrevious()
to get the properyii\web\HttpException
that is the one that has thestatusCode
property.