Update uploadWithRetries to pass the response object to the callback if there was an error

This allows callers to examine the response object and determine how to handle the error