Elao / ErrorNotifierBundle

This bundle send you an email when an error appear (500 or 404 if enable)
59 stars 27 forks source link

PDO error triggers Elao Twig template error #68

Open ArlingtonHouse opened 7 years ago

ArlingtonHouse commented 7 years ago

Hi thanks for a great bundle! I've got a bug in our code that's causing problems for Elao ErrorNotifier. I'm not sure what the underlying PDO issue is, any thoughts on this? Thanks!

[2017-06-13 12:59:35] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("SQLSTATE[HY000]: General error")." at /vendor/elao/error-notifier-bundle/Resources/views/mail.html.twig line 456 {"exception":"[object] (Twig_Error_Runtime(code: 0): An exception has been thrown during the rendering of a template (\"SQLSTATE[HY000]: General error\"). at /vendor/elao/error-notifier-bundle/Resources/views/mail.html.twig:456, PDOException(code: HY000): SQLSTATE[HY000]: General error at /vendor/elao/error-notifier-bundle/Twig/DumpyTwigFilter.php:222)"}

ArlingtonHouse commented 7 years ago

Some additional info-- discovered that the underlying bug wasn't related to PDO. So this seems like a Twig/PDO problem with the Elao Error Notifier.

binarious commented 7 years ago

mail.html.twig at line 456 prints out the scope variables. Maybe this hits a Doctrine object which triggers some lazy-loading of a property. This could result in a database error. I think it would be useful to try and catch database errors in the DumpyTwigFilter. What do you think, @benji07?