/** * @throws HttpException */ protected function handleError() { $body = (string) $this->response->getBody(); $code = (int) $this->response->getStatusCode(); $content = json_decode($body); throw new HttpException(isset($content->message) ? $content->message : 'Request not processed.', $code); }
/** * @throws HttpException */ protected function handleError() { $body = (string) $this->response->getBody(); $code = (int) $this->response->getStatusCode(); $content = json_decode($body); $error = $content->errors[0]; throw new HttpException(isset($error) ? $error->description : 'Request not processed.', $code); }