getMessage(); $code = $exception->getCode(); if ($exception instanceof HttpException) { $message = $exception->getResponse()->getBody()->__toString(); $this->body = json_decode($message, true); $code = $exception->getResponse()->getStatusCode(); } parent::__construct($message, $code, $exception->getPrevious()); } /** * Returns the body. * * @return array $body - the json decoded body from the http response */ public function getBody() { return $this->body; } }