示例#1
0
 /**
  * @param string            $message
  * @param RequestInterface  $request
  * @param ResponseInterface $response
  * @param \Exception|null   $previous
  */
 public function __construct($message, RequestInterface $request, ResponseInterface $response, \Exception $previous = null)
 {
     parent::__construct($message, $request, $previous);
     $this->response = $response;
     $this->code = $response->getStatusCode();
 }
 /**
  * @param RequestException $adapterException
  *
  * @return ProxyUnreachableException
  */
 public static function proxyUnreachable(RequestException $adapterException)
 {
     $message = sprintf('Request to caching proxy at %s failed with message "%s"', $adapterException->getRequest()->getHeaderLine('Host'), $adapterException->getMessage());
     return new self($message, 0, $adapterException);
 }