rigor789 / airbrake-laravel

Laravel package for the Airbrake API, which supports Errbit
MIT License
16 stars 9 forks source link

Ignore exception not working #5

Closed adamtester closed 9 years ago

adamtester commented 9 years ago

I can't seem to ignore 404 errors, this is what I have:

  'ignore_exceptions'   => [
    'Symfony\Component\HttpKernel\Exception\NotFoundHttpException',  
    'NotFoundHttpException'
  ],

But they still show up in airbrake?

rigor789 commented 9 years ago

Hey, had a quick look, and I believe airbrake changed their api a little bit. As an alternative, try adding your exceptions to the

protected $dontReport = [
    HttpException::class,
    ModelNotFoundException::class,
];

Inside app/Exceptions/Handler.php

And that should skip the airbrake integration completely!

If that doesn't work I'll take a deeper look to find the problem!

adamtester commented 9 years ago

Hmm my $dontReport already has HttpException

protected $dontReport = [
    HttpException::class,
];

I wouldn't mind the 404 errors but I get about 20 a day just from bots trying to hack the site lol

rigor789 commented 9 years ago

@AdamTester can you please test out the change and see if it resolves your issue?

adamtester commented 9 years ago

@rigor789 ok for some reason I can't get it to work, nginx returns a 500 with no errors in any logs when I use the code... I'll keep looking into it.

adamtester commented 9 years ago

Ok the problem is this line if($this->shouldReport($e)) { change it to if($this->handler->shouldReport($e)) {

rigor789 commented 9 years ago

Sorry, that was a mistake on my part, does the updated code work properly?

adamtester commented 9 years ago

It does on my local, I'll try and test on my production at some point today

adamtester commented 9 years ago

Tested on production and all working fine! Thanks!