Skip to content

Commit

Permalink
validate connection name before resolve queue connection (#39751)
Browse files Browse the repository at this point in the history
* validate connection name before resolve

* Update QueueManager.php

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
mohamed-foly and taylorotwell authored Nov 24, 2021
1 parent dba65be commit e2baac6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Illuminate/Queue/QueueManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,17 @@ public function connection($name = null)
*
* @param string $name
* @return \Illuminate\Contracts\Queue\Queue
*
* @throws \InvalidArgumentException
*/
protected function resolve($name)
{
$config = $this->getConfig($name);

if (is_null($config)) {
throw new InvalidArgumentException("The [{$name}] queue connection has not been configured.");
}

return $this->getConnector($config['driver'])
->connect($config)
->setConnectionName($name);
Expand Down

0 comments on commit e2baac6

Please sign in to comment.