1: <?php
2: /*
3: * Inventorus
4: *
5: * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ) on 08/26/2016
6: */
7:
8: namespace Inventorus;
9:
10: use Exception;
11:
12: /**
13: * Class for exceptions when there is a network error, status code error, etc.
14: */
15: class APIException extends Exception {
16: /**
17: * HTTP status code
18: * @var int
19: */
20: private $responseCode;
21:
22: /**
23: * Response body
24: * @var mixed
25: */
26: private $responseBody;
27:
28: /**
29: * The HTTP response code from the API request
30: * @param string $reason the reason for raising an exception
31: * @param int $responseCode the HTTP response code from the API request
32: * @param string $responseBody the HTTP response body from the API request
33: */
34: public function __construct($reason, $responseCode, $responseBody)
35: {
36: parent::__construct($reason, $responseCode, NULL);
37: $this->responseCode = $responseCode;
38: $this->responseBody = $responseBody;
39: }
40:
41: /**
42: * The HTTP response code from the API request
43: * @return int
44: */
45: public function getResponseCode()
46: {
47: return $this->responseCode;
48: }
49:
50: /**
51: * The HTTP response body from the API request
52: * @return mixed
53: */
54: public function getResponseBody()
55: {
56: return $this->responseBody;
57: }
58:
59: /**
60: * The reason for raising an exception
61: * @return string
62: */
63: public function getReason()
64: {
65: return $this->message;
66: }
67: }