During the discussion about the APM and the EAP, you saw how dealing with errors can be tricky. The problem with those patterns lies in their multiphased nature, where exceptions can occur at various stages. In the world of the APM, exceptions can come out during
End method calls. When using the EAP, exceptions can occur during the
Async start operation, but can be reported through the
Completed event arguments as well.
For the TAP, things are much simpler. Other than method parameter usage exceptions (such as
ArgumentException), no errors should be raised when invoking the TAP method. Instead, all exceptions have to be propagated through the returned task object. Users of the method can inspect the returned task ...