Skip to content

Instantly share code, notes, and snippets.

@mattrasband
Created September 28, 2016 02:25
Show Gist options
  • Save mattrasband/72880537e48c28e90376e5b57c53d29c to your computer and use it in GitHub Desktop.
Save mattrasband/72880537e48c28e90376e5b57c53d29c to your computer and use it in GitHub Desktop.
import asyncio
async def func_two():
await asyncio.sleep(2.5)
raise RuntimeError
async def func_one():
try:
await func_two()
except RuntimeError as e:
print('Error during async call!')
loop = asyncio.get_event_loop()
loop.run_until_complete(func_one())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment