lukeyouell / craft-sentry

Error tracking that helps developers monitor and fix crashes in real time. Iterate continuously. Boost efficiency. Improve user experience.
https://sentry.io
MIT License
17 stars 10 forks source link

Sentry is not getting the statusCode when twig catch the exception. #7

Closed blasvicco closed 5 years ago

blasvicco commented 6 years ago

In here Sentry is just looking for the property statusCode but if the exception is triggered from the twig file like

{% exit 404 %}

Then the exception that arrive to the event hook is Twig_Error_Runtime that has not a statusCode property.

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.

mwarkentin commented 6 years ago

@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.

lukeyouell commented 5 years ago

Thanks!