Skip to content

Commit

Permalink
Merge pull request #27 from kingsquare/dev-errorhandling
Browse files Browse the repository at this point in the history
added wrapping connection exception in a cb exception
  • Loading branch information
AubreyHewes committed Feb 16, 2017
2 parents 16849f1 + ba740a3 commit 0422276
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Communibase/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use GuzzleHttp\Client;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\ConnectException;
use Psr\Http\Message\StreamInterface;

/**
Expand Down Expand Up @@ -775,6 +776,10 @@ private function call($method, array $arguments)
(($_ =& $response['errors']) ?: [])
);

} catch (ConnectException $e) {

throw new Exception('Can not connect', 500, $e, []);

}
}
}

0 comments on commit 0422276

Please sign in to comment.