Suppose there are several coroutines that we send to the event loop
task_list = [task1(), task2(), task3()]
res = asyncio.gather(*task_list, return_exceptions=True)
Regarding documentation
If return_exceptions is True, exceptions are treated the same as successful results, and aggregated in the result list.
I.e. if for example task2 returns an error, the result will be
res = [task1_result, task2_error, task3_result]
The result is further processed in another process, and I would like to pass some default value if there is an error in the response. The question is how to check for an exception in the event_loop response. Smth like (warning pseudo code!)
response = default if any(res is Error) else res