Skip to content
Snippets Groups Projects
Commit be6e87a9 authored by Gwendolen Lynch's avatar Gwendolen Lynch Committed by Felip Manyer i Ballester
Browse files

Propagate Guzzle exception when rethrowing and remove redundant constructor

parent a6db970e
Branches
Tags
No related merge requests found
...@@ -52,7 +52,7 @@ abstract class Gbif { ...@@ -52,7 +52,7 @@ abstract class Gbif {
$response = $this->gbifClient->get($uri, ['query' => $query_string]); $response = $this->gbifClient->get($uri, ['query' => $query_string]);
} }
catch (ClientException $e) { catch (ClientException $e) {
throw new GbifException($e->getResponse()->getBody()->getContents()); throw new GbifException($e->getResponse()->getBody()->getContents(), $e->getCode(), $e);
} }
$data = (string) $response->getBody(); $data = (string) $response->getBody();
......
...@@ -6,12 +6,4 @@ namespace ResTelae\Gbif; ...@@ -6,12 +6,4 @@ namespace ResTelae\Gbif;
* GBIF: exception handler. * GBIF: exception handler.
*/ */
class GbifException extends \Exception { class GbifException extends \Exception {
/**
* {@inheritdoc}
*/
public function __construct($message = '', $code = 0, \Throwable $previous = NULL) {
parent::__construct($message, $code, $previous);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment