Skip to content

Commit

Permalink
Added exception handling & error response
Browse files Browse the repository at this point in the history
  • Loading branch information
srmklive committed Jun 28, 2016
1 parent b072c5d commit b3705f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/Services/AdaptivePayments.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,13 @@ private function doPayPalRequest($method, $params)
$response = $this->retrieveData($response);

return $response;

} catch (ClientException $e) {
$message = $e->getRequest() . " " . $e->getResponse();
throw new \Exception($e->getRequest() . " " . $e->getResponse());
} catch (ServerException $e) {
$message = $e->getRequest(). " " . $e->getResponse();
throw new \Exception($e->getRequest() . " " . $e->getResponse());
} catch (BadResponseException $e) {
$message = $e->getRequest(). " " . $e->getResponse();
throw new \Exception($e->getRequest() . " " . $e->getResponse());
} catch (\Exception $e) {
$message = $e->getRequest(). " " . $e->getResponse();
}
Expand Down
6 changes: 3 additions & 3 deletions src/Traits/PayPalRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ private function doPayPalRequest($method, $params)
return $response;

} catch (ClientException $e) {
$message = $e->getRequest() . " " . $e->getResponse();
throw new \Exception($e->getRequest() . " " . $e->getResponse());
} catch (ServerException $e) {
$message = $e->getRequest(). " " . $e->getResponse();
throw new \Exception($e->getRequest() . " " . $e->getResponse());
} catch (BadResponseException $e) {
$message = $e->getRequest(). " " . $e->getResponse();
throw new \Exception($e->getRequest() . " " . $e->getResponse());
} catch (\Exception $e) {
$message = $e->getRequest(). " " . $e->getResponse();
}
Expand Down

0 comments on commit b3705f8

Please sign in to comment.