fix: correctly integrate with logger

This commit is contained in:
Björn Fromme
2025-12-17 10:11:53 +01:00
parent 9e2744ef85
commit b661b9f680
@@ -5,14 +5,17 @@ namespace EP\EpProducts\MyEP;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\GenericProvider;
use League\OAuth2\Client\Token\AccessToken;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use Symfony\Component\HttpClient\Exception\ClientException;
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Contracts\HttpClient\Exception\HttpExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class ApiClient
class ApiClient implements LoggerAwareInterface
{
use LoggerAwareTrait;
@@ -113,6 +116,8 @@ class ApiClient
$httpClient->request('POST', 'contactform', [
'json' => $addressData,
]);
} catch (ClientException $e) {
$this->logger->warning($e->getMessage());
} catch (TransportExceptionInterface $e) {
$this->logger->error($e->getMessage());
throw new ApiException($e->getMessage());