Skip to content

Commit

Permalink
Error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
bakura10 committed Nov 23, 2013
1 parent 3f356df commit 153ef6d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.1

* Better error handling

# 1.0.0

* Initial release
4 changes: 2 additions & 2 deletions src/ZfrPaymill/Client/Listener/ErrorHandlerListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ public function handleError(Event $event)
$command = $event['command'];
$result = $command->toArray();

$code = isset($result['data']['response_code']) ? $result['data']['response_code'] : 10001;
$code = isset($result['data']['response_code']) ? $result['data']['response_code'] : 20000;

if ($code >= 40000) {
if ($code !== 20000) {
$exception = new TransactionErrorException($this->errorCodes[$code], $code);
$exception->setRequest($command->getRequest());
$exception->setResponse($command->getResponse());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function provider()
{
return array(
array(
10000,
20000,
null,
null
),
Expand Down

0 comments on commit 153ef6d

Please sign in to comment.