|
|
@@ -1,10 +1,9 @@
|
|
|
<?php
|
|
|
namespace ElkenGit\EknotifierPHP;
|
|
|
|
|
|
+use console\helpers\Logger;
|
|
|
use GuzzleHttp\Client;
|
|
|
use GuzzleHttp\Psr7\Response;
|
|
|
-use GuzzleHttp\Exception\BadResponseException;
|
|
|
-use Illuminate\Support\Facades\Log;
|
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
|
|
/**
|
|
|
@@ -123,10 +122,8 @@ class EknotifierCommon
|
|
|
try {
|
|
|
return $this->httpClient->request('POST', $url, $params);
|
|
|
} catch (\Exception $exception) {
|
|
|
- if ($exception instanceof BadResponseException) {
|
|
|
- if (class_exists(\Illuminate\Log\Logger::class)) {
|
|
|
- Log::critical('EKNOTIFIER ERROR' . $exception->getResponse()->getBody()->getContents());
|
|
|
- }
|
|
|
+ if ($exception instanceof \Exception) {
|
|
|
+ Logger::trace('EKNOTIFIER ERROR' . $exception->getResponse()->getBody()->getContents());
|
|
|
|
|
|
return new Response(
|
|
|
$exception->getResponse()->getStatusCode(),
|
|
|
@@ -137,9 +134,7 @@ class EknotifierCommon
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- if (class_exists(\Illuminate\Log\Logger::class)) {
|
|
|
- Log::critical('EKNOTIFIER ERROR' . $exception->getMessage());
|
|
|
- }
|
|
|
+ Logger::trace('EKNOTIFIER ERROR' . $exception->getMessage());
|
|
|
|
|
|
return new Response(500, [], $exception->getMessage());
|
|
|
}
|