Resolve issue where custom exceptions are reported as errors in Datadog despite report() returning true when using Laravel Octane
I created a and set the method to return , as shown in the code above. In Laravel, this prevents the exception from being reported. Therefore, when using PHP-FP
I created a CustomErrorException and set the report() method to return true, as shown in the code above. In Laravel, this prevents the exception from being reported. Therefore, when using PHP-FPM with Datadog, it does not get recorded as an error.
However, with Octane + Datadog, the exception is still reported as an error even in this case.
To resolve this issue, you can add the following to the $dontReport array in Handler.php:
By doing this, the exception will no longer be reported as an error, even when using Octane + Datadog.
Simply put, with php-fpm + datadog, the exception error is not counted when report() returns true, but with octane + datadog, it is counted as an error even when report() returns true.
To resolve this issue, in Handler.php, add the Exception class to $dontReport.