1: <?php
2:
3: namespace OpenCloud\Common\Exceptions;
4:
5: use Guzzle\Http\Message\RequestInterface;
6: use Guzzle\Http\Message\Response;
7:
8: class HttpResponseException extends \Exception
9: {
10: protected $response;
11: protected $request;
12:
13: /**
14: * Set the request that caused the exception
15: *
16: * @param RequestInterface $request Request to set
17: *
18: * @return RequestException
19: */
20: public function setRequest(RequestInterface $request)
21: {
22: $this->request = $request;
23:
24: return $this;
25: }
26:
27: /**
28: * Get the request that caused the exception
29: *
30: * @return RequestInterface
31: */
32: public function getRequest()
33: {
34: return $this->request;
35: }
36:
37: /**
38: * Set the response that caused the exception
39: *
40: * @param Response $response Response to set
41: */
42: public function setResponse(Response $response)
43: {
44: $this->response = $response;
45: }
46:
47: /**
48: * Get the response that caused the exception
49: *
50: * @return Response
51: */
52: public function getResponse()
53: {
54: return $this->response;
55: }
56: }
57: