Skip to content

Commit

Permalink
add error handling and retry
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrtye committed Oct 30, 2024
1 parent 8dc826f commit 5ad27db
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

0 comments on commit 5ad27db

Please sign in to comment.