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

@@ -76,13 +76,29 @@ async def consume_ws_get_partida(**kwargs):
# Enviar documento
_file_name = f"vu_PT_{pedimento_app}_{partida.get('numero', '')}.xml"
document_response = await partida_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=1,
)
try:
if soap_error(soap_response):
document_response = await partida_rest_controller.post_document(
soap_response=soap_response,
organizacion=kwargs.get('pedimento').get('organizacion'),
pedimento=kwargs.get('pedimento').get('id'),
file_name=f"vu_PT_{pedimento_app}_{partida.get('numero', '')}_ERROR.xml",
document_type=10,
)
raise Exception("Error en la respuesta del servicio SOAP")
else:
document_response = await partida_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=1,
)
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 Partida")