Description
There are a bunch of places in the code where an Exception is caught and then later thrown. This kind of re-throwing ends up clobbering the original call stack and Watson bucket stored in the Exception, making it more difficult for someone looking at the exception to understand where it came from. To address this, ExceptionDispatchInfo was added in .NET 4.5, and is now used in places like Task that have this exact issue. I'd suggest we look at using ExceptionDispatchInfo in all of these places. Basically, instead of just storing an Exception, you'd store the result of ExceptionDispatchInfo.Capture(caughtException), and then instead of using throw _caughtException;, you'd do _caughtExceptionDispatchInfo.Throw();. ExceptionDispatchInfo will preserve the original information and append the new throw location's call stack rather than using it to overwrite the original.
This was discussed in dotnet/corefx#5541 (comment).