fix exception mapping in the returned task block