Before tap, to catch exceptions to a task in a thread, there are usually two ways:
1. Blocking: After the thread starts, at the appropriate time, call wait, or the WaitAll method.
2, non-blocking (recommended): When the task is set up, write the ContinueWith method of the task and catch the exception in the method.
For the tap era, if we were to capture a task with the Asyn keyword, the ContinueWith method would capture the failure. It is also not possible to register a global static method.
Blocking: Consistent with tap before.
Non-blocking: With
Await Task.whenall ()
Await t.wait ()
Await T.result, etc. can be.
The premise is to have an await keyword, which looks good, saves ContinueWith, but the problem is that await is only allowed to execute in the function of the ASYN flag, which can cause contagious problems for your program.
This can be said that the await keyword in fact and continuewith the role of similar, but simplified the wording, so that the program look more orderly, but the cost is not a bit large?
About exception trapping for async & await (TAP) async Models