From 5ad27dbf1bfb36a1244c8c9371d5aafec91c897d Mon Sep 17 00:00:00 2001 From: sgrtye Date: Wed, 30 Oct 2024 14:37:40 +0000 Subject: [PATCH] add error handling and retry --- test/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/main.py b/test/main.py index 6e209e5..316c386 100644 --- a/test/main.py +++ b/test/main.py @@ -109,4 +109,10 @@ async def main(): if __name__ == "__main__": - asyncio.run(main()) + while True: + try: + asyncio.run(main()) + + except Exception as e: + print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"), repr(e)) + print(f"Error occurred on line {e.__traceback__.tb_lineno}")