Wrap exceptions during tasks in a TaskException, storing the message, for improved error reporting later on.