getResponse()->getStatusCode()); $this->context = $context; $this->errorMessage = $reason; if (get_class() != 'APIException') { $this->unbox(); } } /** * Unbox response into this exception class */ public function unbox() { } /** * The HTTP context from the API request * @return Http\HttpContext */ public function getContext() { return $this->context; } /** * The HTTP response code from the API request * @return int */ public function getResponseCode() { return $this->context->getResponse()->getStatusCode(); } /** * The HTTP response body from the API request * @return mixed */ public function getResponseBody() { return $this->context->getResponse()->getRawBody(); } /** * The reason for raising an exception * @return string */ public function getReason() { return $this->message; } }