/** * @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; }
private function isNotFoundError(Exception $exception) { return $exception instanceof HttpException && $exception->getResponse()->getStatusCode() == self::NOT_FOUND_STATUS_CODE; }