Skip to content

Commit

Permalink
use new get error method for logger
Browse files Browse the repository at this point in the history
  • Loading branch information
N1ghteyes committed Dec 15, 2019
1 parent dd40138 commit 4a75df4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/apicore/structure/apicore.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ public function __call($name, $arguments)

if(isset($this->logger)){
$this->logger->setResponseTime(time());
if(!empty($response->error)){
$this->logger->addRawResponse($response->error->message);
$this->logger->addResponseStatusCode($response->error->code);
if(!empty($error = $response::getError())){
$this->logger->addRawResponse($error['message']);
$this->logger->addResponseStatusCode($error['code']);
} else {
$this->logger->addRawResponse($response->rawBodyData);
$this->logger->addResponseStatusCode($response->statusCode);
Expand Down

0 comments on commit 4a75df4

Please sign in to comment.