Giter Club home page Giter Club logo

Comments (5)

adamgoose avatar adamgoose commented on May 18, 2024

Yeah, this is for sure an issue, and likely going to be incredibly difficult to fix.

from bugsnag-laravel.

adamgoose avatar adamgoose commented on May 18, 2024

I was able to thwart this issue by doing the following:

  1. NOT include the BugsnagLaravelServiceProvider
  2. Using php artisan make:provider BugsnagServiceProvider
  3. Editing this provider to include the same register() method as the shipped provider.
  4. Updating my App\Exceptions\Handler (except it's not App), and replacing that report() method with the same report() method as the shipped handler.

from bugsnag-laravel.

johnnygreen avatar johnnygreen commented on May 18, 2024

Also having this issue. Should bugsnag extend Illuminate\Foundation\Exceptions\Handler instead?

from bugsnag-laravel.

johnnygreen avatar johnnygreen commented on May 18, 2024

An alt to doing what adamgoose suggested.

http://laravel.com/docs/5.0/errors#handling-errors

We can temp put this in the main handler:

app/Exceptions/Handler.php

public function report(Exception $e)
{
  $shouldReport = true;

  foreach ($this->dontReport as $type)
  {
      if ($e instanceof $type)
      {
          $shouldReport = false;
      }
  }

  if ($shouldReport) 
  {
     $bugsnag = \App::make('bugsnag');
     $bugsnag->notifyException($e);
  }

  return parent::report($e);
}

We need to override the singleton they bind in their service provider but keep all the rest of the functionality.

So then make your own exception service provider and place it right after the bugsnag one with this in it:

config/app.php

'providers' => ...
  'Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider',
  'MyNamespace\Providers\ExceptionServiceProvider',

app/Providers/ExceptionServiceProvider.php

<?php namespace MyNamespace\Providers;

use Illuminate\Support\ServiceProvider;

class ExceptionServiceProvider extends ServiceProvider {

  public function boot()
  {
    $this->app->singleton('Illuminate\Contracts\Debug\ExceptionHandler', 'MyNamespace\Exceptions\Handler');
  }

  public function register(){}
}

from bugsnag-laravel.

ConradIrwin avatar ConradIrwin commented on May 18, 2024

I'd love feedback on #40 — would that work for everyone?

from bugsnag-laravel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.