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

Better laravel-5 support #40

Merged
merged 1 commit into from
Feb 7, 2015
Merged

Better laravel-5 support #40

merged 1 commit into from
Feb 7, 2015

Conversation

ConradIrwin
Copy link
Contributor

No description provided.

@loopj
Copy link
Contributor

loopj commented Feb 7, 2015

👯

@johnnygreen
Copy link

I almost think that you shouldn't implement a BugsnagExceptionHandler at all.

Just instruct people to include a small snippet of code in the Exception Handler report method provided below. I think that's what Taylor is hinting at in the docs.

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

app/Exceptions/Handler.php

<?php namespace App\Exceptions;

use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler {

  /**
   * A list of the exception types that should not be reported.
   *
   * @var array
   */
  protected $dontReport = [
    'Symfony\Component\HttpKernel\Exception\HttpException'
  ];

  /**
   * Report or log an exception.
   *
   * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
   *
   * @param  \Exception  $e
   * @return void
   */
  public function report(Exception $e)
  {
    // added lines here
    if ( ! $this->shouldntReport($e))
    {
       \Bugsnag::notifyException($e);
    }      

    return parent::report($e);
  }

  /**
   * Render an exception into an HTTP response.
   *
   * @param  \Illuminate\Http\Request  $request
   * @param  \Exception  $e
   * @return \Illuminate\Http\Response
   */
  public function render($request, Exception $e)
  {
    return parent::render($request, $e);
  }

}

@kattrali kattrali deleted the laravel-5-again branch November 17, 2015 01:45
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

Successfully merging this pull request may close these issues.

None yet

3 participants