Skip to content

Commit

Permalink
Merge pull request #682 from Yendall/guzzle_exception_fix
Browse files Browse the repository at this point in the history
Guzzle exception fix
  • Loading branch information
calcinai authored Feb 7, 2020
2 parents 3f08234 + 3e12bbc commit 5619363
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/XeroPHP/Remote/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public function __construct(Application $app, URL $url, $method = self::METHOD_G
}

/**
* @return Response
* @throws Exception
* @throws Exception\BadRequestException
* @throws Exception\ForbiddenException
Expand All @@ -109,17 +108,15 @@ public function send()

try {
$guzzleResponse = $this->app->getTransport()->send($request);
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
throw new Exception($e->getMessage(), $e->getCode());
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
$guzzleResponse = $e->getResponse();
}

$this->response = new Response($this,
$guzzleResponse->getBody()->getContents(),
$guzzleResponse->getStatusCode(),
$guzzleResponse->getHeaders()
);
$this->response->parse();

return $this->response;
}

Expand Down

0 comments on commit 5619363

Please sign in to comment.