Skip to content

Commit 876a3fa

Browse files
author
nicolas.couet
committed
Change from error to warning when try to add alias on unknown queue
1 parent 870d68f commit 876a3fa

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Queue Client Bundle Changelog
22

3+
## v1.0.3
4+
5+
- Change from error to warning when try to add alias on unknown queue
6+
37
## v1.0.2
48

59
- Add AWS backwards compatibility

QueueClientFactory.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
namespace ReputationVIP\Bundle\QueueClientBundle;
44

5+
use Psr\Log\LoggerInterface;
56
use ReputationVIP\Bundle\QueueClientBundle\Configuration\QueuesConfiguration;
67
use ReputationVIP\QueueClient\Adapter\AdapterInterface;
8+
use ReputationVIP\QueueClient\Adapter\Exception\QueueAccessException;
79
use ReputationVIP\QueueClient\QueueClient;
810
use ReputationVIP\QueueClient\QueueClientInterface;
911
use Symfony\Component\Config\Definition\Processor;
@@ -42,6 +44,8 @@ public static function resolveParameters(&$item, $key, $container)
4244
*/
4345
public function get($container, $adapter, $queuesFile)
4446
{
47+
/** @var LoggerInterface $logger */
48+
$logger = $container->get('logger');
4549
$queueClient = new QueueClient($adapter);
4650
$processor = new Processor();
4751
$configuration = new QueuesConfiguration();
@@ -53,6 +57,8 @@ public function get($container, $adapter, $queuesFile)
5357
foreach ($queue[QueuesConfiguration::QUEUE_ALIASES_NODE] as $alias) {
5458
try {
5559
$queueClient->addAlias($queueName, $alias);
60+
} catch (QueueAccessException $e) {
61+
$logger->warning($e->getMessage());
5662
} catch (\ErrorException $e) {
5763
if ($e->getSeverity() === E_ERROR) {
5864
throw $e;

0 commit comments

Comments
 (0)