spatie/flare-client-php

Flare in WordPress project: all error levels sent to Flare and reported as `ErrorException`

benjibee opened this issue · 1 comments

After signing up for a trial with Flare I quickly hit the 1000 exception limit. Going through everything sent to Flare, I see that deprecation notices, warnings, and everything in between is being caught and sent to Flare as an ErrorException.

Examples

Attempting to access a non-existent array key without Flare shows the following error in my server's log file

PHP Warning: Undefined array key 1 in [...]/inc/template-functions.php on line 307

Called a the deprecated WordPress function get_page_by_title() shows the following error in my server's log file

PHP Deprecated: Function get_page_by_title() is <strong>deprecated</strong> since version 6.20! Use WP_Query instead.

Attempted solutions

Both of these are caught and reported by Flare as an instance of ErrorException. I've tried both the registerMiddleware() and filterReportsUsing() methods but they are both passed an instance of Spatie\FlareClient\Report which already shows the $exceptionClass property as being an instance of ErrorException.

Expected behaviour

I wouldn't expect warnings and deprecation notices to be cast into exceptions and sent to Flare.

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.