mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 23:23:51 +00:00
Merge branch 'master' into feat/add-document-encrypter-service
This commit is contained in:
@@ -14,8 +14,10 @@ namespace Chill\DocGeneratorBundle\GeneratorDriver;
|
||||
use Chill\DocGeneratorBundle\GeneratorDriver\Exception\TemplateException;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
use Symfony\Component\HttpClient\Exception\ClientException;
|
||||
use Symfony\Component\Mime\Part\DataPart;
|
||||
use Symfony\Component\Mime\Part\Multipart\FormDataPart;
|
||||
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
|
||||
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
|
||||
use Symfony\Contracts\HttpClient\Exception\HttpExceptionInterface;
|
||||
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
|
||||
@@ -54,7 +56,9 @@ final class RelatorioDriver implements DriverInterface
|
||||
'headers' => $form->getPreparedHeaders()->toArray(),
|
||||
'body' => $form->bodyToIterable(),
|
||||
]);
|
||||
} catch (HttpExceptionInterface $e) {
|
||||
|
||||
return $response->getContent();
|
||||
} catch (ClientExceptionInterface $e) {
|
||||
$content = $e->getResponse()->getContent(false);
|
||||
|
||||
if (400 === $e->getResponse()->getStatusCode()) {
|
||||
@@ -87,6 +91,18 @@ final class RelatorioDriver implements DriverInterface
|
||||
]);
|
||||
|
||||
throw $e;
|
||||
} catch (Throwable $exception) {
|
||||
$this
|
||||
->logger
|
||||
->error(
|
||||
'relatorio: Unable to get content from response.',
|
||||
[
|
||||
'msg' => $exception->getMessage(),
|
||||
'e' => $exception->getTraceAsString(),
|
||||
]
|
||||
);
|
||||
|
||||
throw $exception;
|
||||
}
|
||||
|
||||
try {
|
||||
|
Reference in New Issue
Block a user