Example #1
0
 /**
  * Handle http client exceptions
  *
  * @param  HttpClientException $e
  *
  * @return void
  * @throws Exception
  */
 private function handleRequestException(HttpClientException $e)
 {
     if ($response = $e->getResponse()) {
         $exception = new Exception($response->getReasonPhrase(), $response->getStatusCode(), $e);
         $exception->setBody(json_decode($response->getBody()));
         throw $exception;
     }
     throw new Exception($e->getMessage(), 500, $e);
 }