Skip to content

Commit

Permalink
Try catching asyncio exception w/ error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
ayjayt committed Sep 27, 2024
1 parent 185b2fa commit 3d37467
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion devtools/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,10 @@ def diagnose():
fail.append(e)
finally:
print("Done with sync test".center(50, "*"))

def error_handler(loop, context):
print(context)
async def test():
asyncio.get_running_loop().set_exception_handler(error_handler)
try:
print("Internal running Asyncio Test".center(50, "*"))
browser = await Browser(debug=True, debug_browser=True)
Expand Down

0 comments on commit 3d37467

Please sign in to comment.