Skip to content
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

Add the ability to supress specific exceptions #30

Closed
jaymeh opened this issue Mar 7, 2023 · 1 comment
Closed

Add the ability to supress specific exceptions #30

jaymeh opened this issue Mar 7, 2023 · 1 comment

Comments

@jaymeh
Copy link

jaymeh commented Mar 7, 2023

There are times where I'd quite like to have more granular control over which exceptions are being logged into Sentry by my application. I'm, wondering if in the configuration for this module we could have the ability to add specific error classes to an array which are ignored.

This should be easy to achieve by tapping into the error handling function and adding an extra check to see if we should log that exception:

Event::on(
    ErrorHandler::class,
    ErrorHandler::EVENT_BEFORE_HANDLE_EXCEPTION,
    function(ExceptionEvent $event) {
        $this->sentry->handleException($event->exception);
    }
);

I was sure at one point Laravel gave you that level of fine control but can't seem to find an example 🤔

Happy to submit a PR for this if you think it could be useful.

Thanks

@roelvanhintum
Copy link
Member

Sorry, for the very late response.
Added an ignoreErrors option in 3.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants