fix: correctly integrate with logger
This commit is contained in:
@@ -5,14 +5,17 @@ namespace EP\EpProducts\MyEP;
|
|||||||
use League\OAuth2\Client\Provider\AbstractProvider;
|
use League\OAuth2\Client\Provider\AbstractProvider;
|
||||||
use League\OAuth2\Client\Provider\GenericProvider;
|
use League\OAuth2\Client\Provider\GenericProvider;
|
||||||
use League\OAuth2\Client\Token\AccessToken;
|
use League\OAuth2\Client\Token\AccessToken;
|
||||||
|
use Psr\Log\LoggerAwareInterface;
|
||||||
use Psr\Log\LoggerAwareTrait;
|
use Psr\Log\LoggerAwareTrait;
|
||||||
|
use Symfony\Component\HttpClient\Exception\ClientException;
|
||||||
use Symfony\Component\HttpClient\HttpClient;
|
use Symfony\Component\HttpClient\HttpClient;
|
||||||
|
use Symfony\Contracts\HttpClient\Exception\HttpExceptionInterface;
|
||||||
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
|
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
|
||||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||||
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
|
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
|
||||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||||
|
|
||||||
class ApiClient
|
class ApiClient implements LoggerAwareInterface
|
||||||
{
|
{
|
||||||
use LoggerAwareTrait;
|
use LoggerAwareTrait;
|
||||||
|
|
||||||
@@ -113,6 +116,8 @@ class ApiClient
|
|||||||
$httpClient->request('POST', 'contactform', [
|
$httpClient->request('POST', 'contactform', [
|
||||||
'json' => $addressData,
|
'json' => $addressData,
|
||||||
]);
|
]);
|
||||||
|
} catch (ClientException $e) {
|
||||||
|
$this->logger->warning($e->getMessage());
|
||||||
} catch (TransportExceptionInterface $e) {
|
} catch (TransportExceptionInterface $e) {
|
||||||
$this->logger->error($e->getMessage());
|
$this->logger->error($e->getMessage());
|
||||||
throw new ApiException($e->getMessage());
|
throw new ApiException($e->getMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user