Errores
This commit is contained in:
@@ -70,6 +70,13 @@ async def consume_ws_get_partida(**kwargs):
|
||||
raise Exception("No se recibió respuesta del servicio SOAP")
|
||||
|
||||
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")
|
||||
|
||||
logger.info("Respuesta SOAP exitosa, enviando documento")
|
||||
@@ -77,23 +84,14 @@ async def consume_ws_get_partida(**kwargs):
|
||||
# Enviar documento
|
||||
_file_name = f"vu_PT_{pedimento_app}_{partida.get('numero', '')}.xml"
|
||||
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,
|
||||
)
|
||||
|
||||
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)}")
|
||||
|
||||
Reference in New Issue
Block a user