/**
  * Executed on failure
  *
  * @param OutputInterface $output
  * @param string          $region
  * @param int             $gameId
  * @param string          $encryptionKey
  * @param string          $replayFolderPath
  * @param \Exception      $exception
  *
  * @throws \Exception
  *
  * @return null|bool
  */
 public function onFailure(OutputInterface $output, $region, $gameId, $encryptionKey, $replayFolderPath, \Exception $exception)
 {
     $failureHandler = null;
     try {
         $failureHandler = Config::get('replay.command.handler.failure');
     } catch (ConfigurationKeyNotFoundException $e) {
         // Failure handler is not set
     }
     $throwException = true;
     if (null != $failureHandler) {
         $failureHandlerClass = new $failureHandler();
         if (!$failureHandlerClass instanceof FailureHandlerInterface) {
             throw new \InvalidArgumentException('The failure handler class ' . $failureHandler . ' should implement \\EloGank\\Component\\Handler\\FailureHandlerInterface');
         }
         $throwException = $failureHandlerClass->onFailure($output, $region, $gameId, $encryptionKey, $replayFolderPath, $exception);
     }
     if (Config::get('replay.command.exception.throw') && true === $throwException) {
         throw $exception;
     }
     $output->writeln('');
     $this->error($output, $exception->getMessage());
 }
 /**
  * Executed on failure
  *
  * @param string     $region
  * @param int        $gameId
  * @param string     $encryptionKey
  * @param string     $replayFolderPath
  * @param \Exception $exception
  */
 public function onFailure($region, $gameId, $encryptionKey, $replayFolderPath, \Exception $exception)
 {
     $failureHandler = null;
     try {
         $failureHandler = Config::get('replay.command.handler.failure');
     } catch (ConfigurationKeyNotFoundException $e) {
         // Failure handler is not set
     }
     if (null != $failureHandler) {
         $failureHandlerClass = new $failureHandler();
         if (!$failureHandlerClass instanceof FailureHandlerInterface) {
             throw new \InvalidArgumentException('The failure handler class ' . $failureHandler . ' should implement \\EloGank\\Component\\Handler\\FailureHandlerInterface');
         }
         $failureHandlerClass->onFailure($region, $gameId, $encryptionKey, $replayFolderPath, $exception);
     }
 }
 public function __construct()
 {
     $this->redisClient = new \Predis\Client(array('scheme' => Config::get('redis.scheme'), 'host' => Config::get('redis.host'), 'password' => Config::get('redis.password'), 'port' => Config::get('redis.port')));
     $connection = new \Domnikl\Statsd\Connection\UdpSocket(Config::get('statsd.host'), Config::get('statsd.port'));
     $this->statsdClient = new \Domnikl\Statsd\Client($connection, Config::get('statsd.namespace'));
 }