From 2ddd9d5cd9581a7e2a83de471cec8aec80f9dbee Mon Sep 17 00:00:00 2001 From: Slivo-fr Date: Thu, 9 May 2019 14:54:18 +0200 Subject: [PATCH] Limit errors cases that will send mails --- src/CurlWrapper.php | 1 - src/Killbot.php | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/CurlWrapper.php b/src/CurlWrapper.php index 39982bf..d6f9298 100644 --- a/src/CurlWrapper.php +++ b/src/CurlWrapper.php @@ -82,7 +82,6 @@ static protected function handleErrors($output, $ch) { if ($http_code >= 400) { throw new Exception('HTTP error : ' . $http_code . ' on ' . curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)); - } } } \ No newline at end of file diff --git a/src/Killbot.php b/src/Killbot.php index e45225e..bc289e8 100644 --- a/src/Killbot.php +++ b/src/Killbot.php @@ -106,7 +106,12 @@ private function processKill($data = null) ); } - throw $exception; + if (Settings::$ENV === 'DEV') { + throw $exception; + } else { + Logger::log($exception->getMessage()); + return false; + } } }