Closed tomasf closed 3 years ago
Hi @tomasf,
Thanks for the PR, this looks like a very reasonable change. I'm going to see about fixing the CI build in master (it appears circle removed the particular xcode we were using to test UA), and then we should be able to get this merged in.
Thanks, @gwhelanLD
Previous behavior
For
UnsuccessfulResponseError
, the error handler is consulted but its action is never used. The data task is then cancelled, leading to aURLError.cancelled
error, and the error handler's action for this error is what is used for deciding the behavior. This is probably not what anyone expects or wants.New behavior
If the error handler returns
.shutdown
for unsuccessful response errors, we setreadyState
to.shutdown
. The error handler never gets theURLError.cancelled
error andafterComplete()
shuts down.