Skip to content

Commit

Permalink
more debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Kerin committed Aug 8, 2018
1 parent 5811281 commit c280b20
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Connection/RestClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Blocktrail\SDK\Throttler;
use Composer\CaBundle\CaBundle;
use GuzzleHttp\Client as Guzzle;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Handler\CurlHandler;
use GuzzleHttp\HandlerStack;
use HttpSignatures\Context;
Expand Down Expand Up @@ -145,7 +146,18 @@ public function request($method, $endpointUrl, $queryString = null, $body = null
$this->throttler->waitForThrottle();
echo "Fired request at " . microtime(true) . PHP_EOL;
$request = $this->buildRequest($method, $endpointUrl, $queryString, $body, $auth, $contentMD5Mode, $timeout);
$response = $this->guzzle->send($request, ['auth' => $auth, 'timeout' => $timeout]);
try {
$response = $this->guzzle->send($request, ['auth' => $auth, 'timeout' => $timeout]);
} catch (RequestException $e) {
$debugR = $e->getRequest();
print_r($debugR->getMethod());
print_r($debugR->getUri());
print_r($debugR->getRequestTarget());
print_r($debugR->getHeaders());
print_r($debugR->getBody());
throw $e;
}


return $this->responseHandler($response);
}
Expand Down

0 comments on commit c280b20

Please sign in to comment.