Skip to content

Commit

Permalink
avoid too many verbose logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrousseauDigitick committed Jun 6, 2018
1 parent 735c07c commit f444cfb
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Digitick/Foundation/Fuse/Command/Http/HttpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f444cfb

Please sign in to comment.