From 3839b050b924c7f2a9041d1d40bacce46f2693e3 Mon Sep 17 00:00:00 2001 From: fti7 Date: Mon, 22 Jul 2024 20:53:04 +0200 Subject: [PATCH] add reply debug logging --- utils.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/utils.py b/utils.py index 4c4c360..a6f9bc4 100644 --- a/utils.py +++ b/utils.py @@ -16,12 +16,18 @@ def send_message(message, destination, interface): max_payload_size = 200 for i in range(0, len(message), max_payload_size): chunk = message[i:i + max_payload_size] - interface.sendText( - text=chunk, - destinationId=destination, - wantAck=False, - wantResponse=False - ) + try: + d = interface.sendText( + text=chunk, + destinationId=destination, + wantAck=False, + wantResponse=False + ) + logging.info(f"REPLY SEND ID={d.id}") + except Exception as e: + logging.info(f"REPLY SEND ERROR {e.message}") + + time.sleep(2)