report() public method

This is a great spot to send exceptions to Sentry, Bugsnag, etc.
public report ( Exception $e )
$e Exception
 public function testReport()
 {
     $path = base_path('tests/storage/logs/report.log');
     \Log::useFiles($path);
     $this->handler->report(new \ErrorException('testing error'));
     $this->assertFileExists($path);
     $content = file_get_contents($path);
     $this->assertNotFalse(strpos($content, 'testing error'));
     $this->beforeApplicationDestroyed(function () use($path) {
         \File::delete($path);
     });
 }
Example #2
0
 /**
  * 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)
 {
     $this->dontReport[] = 'KodiCMS\\Pages\\Exceptions\\PageNotFoundException';
     $this->dontReport[] = PermissionsException::class;
     $this->dontReport[] = 'KodiCMS\\API\\Exceptions\\PermissionException';
     $this->dontReport[] = ValidationException::class;
     parent::report($e);
 }
Example #3
0
 /**
  * Report exception to bugsnag.
  *
  * @author Casper Rasmussen <*****@*****.**>
  * @author Morten Rugaard <*****@*****.**>
  *
  * @param  \Exception $e
  * @return void
  */
 public function report(Exception $e)
 {
     try {
         if ($e instanceof NodesException && $e->getReport()) {
             app('nodes.bugsnag')->notifyException($e, $e->getMeta(), $e->getSeverity());
         } elseif (!$e instanceof NodesException && $this->shouldReport($e)) {
             app('nodes.bugsnag')->notifyException($e, null, 'error');
         }
     } catch (Exception $e) {
         // Do nothing
     }
     return parent::report($e);
 }
 /**
  * Report or log an exception.
  *
  * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  *
  * @param  \Exception $e
  */
 public function report(Exception $e)
 {
     return parent::report($e);
 }