-
-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Excluded exceptions are being ignored when monolog error handler is enabled #924
Comments
FTR, this comes from getsentry/sentry-symfony#273 |
That would not work as you may want to pass a message along with a custom exception (it's a common use case), so with your suggestion you would lose one of the two information anyway. However I don't see any negative point in applying the |
As I already said in getsentry/sentry-symfony#273 (comment), I'm 👎 on altering the
|
Nobody is going to alter the behavior of that method. The change would just move the |
A fix would be great, I got all my NotFoundHttpException and AccessDeniedHttpException back since I enabled the monolog error handler. |
Working on it, I hope to open PR soon! However, I decided to try a more flexible way to handle such cases as it may be legit to use the Monolog handler and expect that all logs are captured regardless of the exception that they have attached, so the fix will likely target version |
For anyone willing to test the solution with PR #928 (which is now available in dev-develop, will be released as 2.3), here's the explanation of how it works: #928 (comment) |
I've recently enabled the monolog error handler on a Symfony project and realized that the excluded exceptions I configured are being reported.
After doing some digging, I've found that
Sentry\Monolog\Handler
relies on thecaptureEvent
method which does not check if the payload contains an exception and if that exception should be ignored. I was wondering if it is an intended beheavior?If not, I would be happy to submit a PR. The idea would be to use either the
captureException
or thecaptureEvent
method whether the payload has anexception
key set.The text was updated successfully, but these errors were encountered: