diff --git a/src/Digitick/Foundation/Fuse/Command/Http/HttpCommand.php b/src/Digitick/Foundation/Fuse/Command/Http/HttpCommand.php index c16ea99..267907e 100644 --- a/src/Digitick/Foundation/Fuse/Command/Http/HttpCommand.php +++ b/src/Digitick/Foundation/Fuse/Command/Http/HttpCommand.php @@ -337,12 +337,17 @@ public function setBody($body) private function exceptionFactory(TransferException $exc) { - $this->error(sprintf("Transfer exception caught. Type : %s, status code = %s, message = %s", - get_class($exc), - $exc->getCode(), - $exc->getMessage() - ) + $errorLog = sprintf("Transfer exception caught. Type : %s, status code = %s, message = %s", + get_class($exc), + $exc->getCode(), + $exc->getMessage() ); + if ($exc->getCode() < 500) { + //avoid too many verbose logs on production + $this->debug($errorLog); + } else { + $this->error($errorLog); + } $thrownException = null; if ($exc instanceof ClientException) {