@@ -46,38 +46,38 @@ use \Exception;
46
46
class ApiException extends Exception
47
47
{
48
48
49
- /**
50
- * The HTTP body of the server response.
51
- * @var string
49
+ /**
50
+ * The HTTP body of the server response either as Json or string .
51
+ * @var mixed
52
52
*/
53
53
protected $responseBody ;
54
-
54
+
55
55
/**
56
56
* The HTTP header of the server response.
57
57
* @var string[]
58
58
*/
59
59
protected $responseHeaders ;
60
-
60
+
61
61
/**
62
62
* The deserialized response object
63
63
* @var $responseObject ;
64
64
*/
65
65
protected $responseObject ;
66
-
66
+
67
67
/**
68
68
* Constructor
69
69
* @param string $message Error message
70
- * @param string $code HTTP status code
70
+ * @param int $code HTTP status code
71
71
* @param string $responseHeaders HTTP response header
72
- * @param string $responseBody Deseralized response object
72
+ * @param mixed $responseBody HTTP body of the server response either as Json or string
73
73
*/
74
74
public function __construct($message =" " , $code =0, $responseHeaders =null, $responseBody =null)
75
75
{
76
76
parent::__construct($message , $code );
77
77
$this -> responseHeaders = $responseHeaders ;
78
78
$this -> responseBody = $responseBody ;
79
79
}
80
-
80
+
81
81
/**
82
82
* Gets the HTTP response header
83
83
*
@@ -87,17 +87,17 @@ class ApiException extends Exception
87
87
{
88
88
return $this -> responseHeaders ;
89
89
}
90
-
90
+
91
91
/**
92
- * Gets the HTTP response body
92
+ * Gets the HTTP body of the server response either as Json or string
93
93
*
94
- * @return string HTTP response body
94
+ * @return mixed HTTP body of the server response either as Json or string
95
95
*/
96
96
public function getResponseBody()
97
97
{
98
98
return $this -> responseBody ;
99
99
}
100
-
100
+
101
101
/**
102
102
* Sets the deseralized response object (during deserialization)
103
103
* @param mixed $obj Deserialized response object
0 commit comments