Skip to content

Commit

Permalink
Stop async loop on error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ouziel committed Jan 10, 2025
1 parent 0a5102a commit cf7fc27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions counterparty-core/counterpartycore/lib/follow.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,8 @@ async def receive_multipart(self, socket, topic_name):
self.receive_message(topic, body, seq)
except Exception as e:
logger.error("Error processing message: %s", e)
import traceback

print(traceback.format_exc()) # for debugging
# import traceback
# print(traceback.format_exc()) # for debugging
capture_exception(e)
raise e

Expand Down Expand Up @@ -297,6 +296,7 @@ async def handle(self):
except Exception as e:
logger.error("Error in handle loop: %s", e)
capture_exception(e)
self.stop()
break # Optionally break the loop on other exceptions

def start(self):
Expand Down

0 comments on commit cf7fc27

Please sign in to comment.