Tackeo de errores

This commit is contained in:
2025-10-04 10:08:26 -06:00
parent 7149515606
commit 7b69aabaf3
5 changed files with 81 additions and 29 deletions

View File

@@ -86,14 +86,28 @@ async def consume_ws_get_cove(**kwargs):
# Enviar documento
_file_name = f"vu_COVE_{pedimento_app}_{cove}.xml"
document_response = await coves_rest_controller.post_document(
soap_response=soap_response,
organizacion=kwargs.get('pedimento').get('organizacion'),
pedimento=kwargs.get('pedimento').get('id'),
file_name=_file_name,
document_type=8,
)
try:
if soap_error(soap_response):
document_response = await coves_rest_controller.post_document(
soap_response=soap_response,
organizacion=kwargs.get('pedimento').get('organizacion'),
pedimento=kwargs.get('pedimento').get('id'),
file_name=f"vu_COVE_{pedimento_app}_{cove}_ERROR.xml",
document_type=10,
)
raise Exception("Error en la respuesta del servicio SOAP")
else:
document_response = await coves_rest_controller.post_document(
soap_response=soap_response,
organizacion=kwargs.get('pedimento').get('organizacion'),
pedimento=kwargs.get('pedimento').get('id'),
file_name=_file_name,
document_type=8,
)
except Exception as e:
logger.error(f"Error detectado en la respuesta SOAP: {str(e)}")
raise Exception(f"Error en la respuesta SOAP: {str(e)}")
logger.info("Documento enviado, actualizando status de COVE")
# Actualizar status del COVE