Add more diagnostics to debug logs

Make it clear:

* What exceptions we've hit
* The exception message
* How many times we've retried this chunk.
Let total attempts by 1 + num_retries

More intuitive that num_retries != num_attempts but instead
num_attempts = 1 + num_retries.  Added a test to verify this.