Skip to content

Commit

Permalink
Merge pull request #53 from Vinelab/error-handling
Browse files Browse the repository at this point in the history
Apply contextual binding for exception handler
  • Loading branch information
adiachenko authored Aug 27, 2019
2 parents 87f104c + 12437b6 commit 234eed4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/BowlerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace Vinelab\Bowler;

use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Support\ServiceProvider;
use Vinelab\Bowler\Console\Commands\QueueCommand;
use Vinelab\Bowler\Console\Commands\ConsumeCommand;
use Vinelab\Bowler\Console\Commands\SubscriberCommand;
use Vinelab\Bowler\Console\Commands\ConsumerHealthCheckCommand;
use Vinelab\Bowler\Contracts\BowlerExceptionHandler;
use Vinelab\Bowler\Exceptions\Handler as BowlerExceptionHandler;

/**
* @author Ali Issa <[email protected]>
Expand Down Expand Up @@ -63,7 +64,9 @@ public function register()
return new Connection($rbmqHost, $rbmqPort, $rbmqUsername, $rbmqPassword, $rbmqConnectionTimeout, $rbmqReadWriteTimeout, $rbmqHeartbeat, $rbmqVhost);
});

$this->app->bind(BowlerExceptionHandler::class, $this->app->getNamespace().'Exceptions\Handler');
$this->app->when(BowlerExceptionHandler::class)
->needs(ExceptionHandler::class)
->give($this->app->getNamespace().'Exceptions\Handler');

//register command
$this->commands([
Expand Down

0 comments on commit 234eed4

Please sign in to comment.