Skip to content

Commit

Permalink
catching 400 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnye committed Mar 9, 2015
1 parent cfdec23 commit 2f02f1e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Message/CompletePurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ public function getData()

public function sendData($data)
{
// don't throw exceptions for 4xx errors
$this->httpClient->getEventDispatcher()->addListener(
'request.error',
function ($event) {
if ($event['response']->isClientError()) {
$event->stopPropagation();
}
}
);

$httpRequest = $this->httpClient->post(
$this->getEndpoint().'/api/v1/confirm',
array('Accept' => 'application/json'),
Expand Down

0 comments on commit 2f02f1e

Please sign in to comment.