Improvements
testing/ogcore-api/pipeline/head This commit looks good
Details
testing/ogcore-api/pipeline/head This commit looks good
Details
parent
6c1b28176a
commit
294a9c5d40
|
@ -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',
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue