Skip to content

Commit

Permalink
Merge pull request #18 from comradefuzz/master
Browse files Browse the repository at this point in the history
Resolves issue #17
  • Loading branch information
ApexWire authored Apr 21, 2017
2 parents ce9bf54 + 1cffe64 commit a26cbd1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Closure;
use GuzzleHttp\Client as Handler;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Psr7\Response;
use yii\base\Component;
use yii\base\InvalidConfigException;
Expand Down Expand Up @@ -146,7 +147,13 @@ public function getQueryBuilder()
*/
public function get($url, $query = [], $body = null, $raw = false)
{
return $this->makeRequest('GET', $url, $query, $body, $raw);
try {
return $this->makeRequest('GET', $url, $query, $body, $raw);
} catch (ClientException $e) {
if (404 === $e->getCode()) {
return false;
}
}
}

/**
Expand Down

0 comments on commit a26cbd1

Please sign in to comment.