2
2
3
3
namespace ReputationVIP \Bundle \QueueClientBundle ;
4
4
5
+ use Psr \Log \LoggerInterface ;
5
6
use ReputationVIP \Bundle \QueueClientBundle \Configuration \QueuesConfiguration ;
6
7
use ReputationVIP \QueueClient \Adapter \AdapterInterface ;
8
+ use ReputationVIP \QueueClient \Adapter \Exception \QueueAccessException ;
7
9
use ReputationVIP \QueueClient \QueueClient ;
8
10
use ReputationVIP \QueueClient \QueueClientInterface ;
9
11
use Symfony \Component \Config \Definition \Processor ;
@@ -42,6 +44,8 @@ public static function resolveParameters(&$item, $key, $container)
42
44
*/
43
45
public function get ($ container , $ adapter , $ queuesFile )
44
46
{
47
+ /** @var LoggerInterface $logger */
48
+ $ logger = $ container ->get ('logger ' );
45
49
$ queueClient = new QueueClient ($ adapter );
46
50
$ processor = new Processor ();
47
51
$ configuration = new QueuesConfiguration ();
@@ -53,6 +57,8 @@ public function get($container, $adapter, $queuesFile)
53
57
foreach ($ queue [QueuesConfiguration::QUEUE_ALIASES_NODE ] as $ alias ) {
54
58
try {
55
59
$ queueClient ->addAlias ($ queueName , $ alias );
60
+ } catch (QueueAccessException $ e ) {
61
+ $ logger ->warning ($ e ->getMessage ());
56
62
} catch (\ErrorException $ e ) {
57
63
if ($ e ->getSeverity () === E_ERROR ) {
58
64
throw $ e ;
0 commit comments