Skip to content

Commit 3a84b37

Browse files
authored
Merge pull request #49 from re8260/48
#48 fix(ErrorParsing) - added case for Errors parameter name parsing
2 parents f1504a1 + aa8d79d commit 3a84b37

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

core/Client.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,17 @@ private function parseExceptionResponse($e)
390390
);
391391
}
392392

393+
if (isset($doc) &&
394+
isset($doc->Errors) &&
395+
isset($doc->Errors->Description) &&
396+
isset($doc->Errors->Code))
397+
{
398+
throw new ResponseException(
399+
(string) $doc->Errors->Description,
400+
(int) $doc->Errors->Code
401+
);
402+
}
403+
393404
throw new ResponseException($e->getMessage(), $e->getResponse()->getStatusCode());
394405
}
395406
}

0 commit comments

Comments
 (0)