Improvements
testing/ogcore-api/pipeline/head This commit looks good Details

pull/33/head
Manuel Aranda Rosales 2025-05-19 16:42:22 +02:00
parent 6c1b28176a
commit 294a9c5d40
2 changed files with 16 additions and 0 deletions

View File

@ -69,6 +69,14 @@ abstract class AbstractOgAgentController extends AbstractController
} catch (ClientExceptionInterface | ServerExceptionInterface $e) {
$this->logger->error(sprintf('Client/Server error in request to %s: %s', $url, $e->getMessage()));
return [
'code' => Response::HTTP_INTERNAL_SERVER_ERROR,
'error' => 'Client/Server error',
'details' => $e->getMessage(),
];
} catch (TransportExceptionInterface $e) {
$this->logger->error(sprintf('Transport error in request to %s: %s', $url, $e->getMessage()));
return [
'code' => Response::HTTP_INTERNAL_SERVER_ERROR,
'error' => 'Client/Server error',

View File

@ -82,6 +82,14 @@ class StatusAction extends AbstractOgAgentController
token: $client->getToken(),
);
if (isset($data['error']) && $data['code'] === Response::HTTP_INTERNAL_SERVER_ERROR) {
$this->logger->error('Error checking client status', ['client' => $client->getId()]);
$client->setStatus(ClientStatus::OFF);
$this->entityManager->persist($client);
$this->entityManager->flush();
throw new ValidatorException('Error deploying image');
}
if (isset($data['cfg'])) {
$this->logger->info('Creating partitions', ['data' => $data['cfg']]);
$this->createPartitionService->__invoke($data, $client);