/**
  * @param Exception $exception
  * @param string    $clientName
  * @param int       $depth
  */
 public function addFailure(Exception $exception, $clientName, $depth)
 {
     if ($exception instanceof Exception\HttpException) {
         $formattedResponse = $this->formatter->formatResponse($exception->getResponse());
     } elseif ($exception instanceof Exception\TransferException) {
         $formattedResponse = $exception->getMessage();
     } else {
         $formattedResponse = sprintf('Unexpected exception of type "%s"', get_class($exception));
     }
     $this->data[$clientName]['response'][$depth][] = $formattedResponse;
     $this->data[$clientName]['failure'][$depth][] = true;
 }
 /**
  * @param HttpClientException $exception
  *
  * @return static
  */
 public static function transportProblem(HttpClientException $exception)
 {
     return new self(sprintf('EventClient has a transport problem:%s', $exception->getMessage()), $exception->getCode(), $exception);
 }
 private function isNotFoundError(Exception $exception)
 {
     return $exception instanceof HttpException && $exception->getResponse()->getStatusCode() == self::NOT_FOUND_STATUS_CODE;
 }