Example #1
0
 /**
  * Fire the job.
  *
  * @return void
  */
 public function fire($job, $data)
 {
     try {
         // Send the data to Sentry.
         $this->raven->sendError($data);
         // Delete the processed job.
         $job->delete();
     } catch (\Exception $e) {
         // Release Job with delay.
         $job->release(30);
     }
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->mergeConfigFrom(__DIR__ . '/config/config.php', 'raven');
     $this->app['log.raven'] = $this->app->share(function ($app) {
         $config = config('raven');
         $queue = $app['queue'];
         $connection = config('raven.queue.connection');
         if ($connection) {
             $queue->connection($connection);
         }
         $client = new Client($config, $queue, $app['session'], $app->environment());
         $client->setCustomQueue(config('raven.queue.queue'));
         return $client;
     });
     $this->app->bind('Psr\\Log\\LoggerInterface', function ($app) {
         return $app['log'];
     });
 }
 public function test_sending_error_no_server()
 {
     $client = new Client([]);
     $this->assertNull($client->sendError([]));
 }