Skip to content

Commit

Permalink
fix(ExceptionNotifyManager): Fix queue connection config key
Browse files Browse the repository at this point in the history
- Change `config('exception-notify.queue_connection')` to `config('exception-notify.queue.connection')`
  • Loading branch information
guanguans committed Aug 4, 2023
1 parent 0298127 commit 094d38f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/ExceptionNotifyManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use Guanguans\Notify\Factory;
use Illuminate\Cache\RateLimiter;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Support\Arr;
use Illuminate\Support\Manager;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
Expand Down Expand Up @@ -89,7 +90,7 @@ public function report(\Throwable $throwable, $channels = null): void

if (
! $this->container->runningInConsole()
&& 'sync' === config('exception-notify.queue_connection')
&& 'sync' === config('exception-notify.queue.connection')
&& method_exists($dispatch, 'afterResponse')
) {
$dispatch->afterResponse();
Expand All @@ -114,10 +115,8 @@ public function shouldntReport(\Throwable $throwable): bool
return true;
}

foreach (config('exception-notify.except') as $type) {
if ($throwable instanceof $type) {
return true;
}
if (Arr::first(config('exception-notify.except'), static fn (string $type): bool => $throwable instanceof $type)) {
return true;
}

return ! $this
Expand Down

0 comments on commit 094d38f

Please sign in to comment.