You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems as though it's currently impossible to surface errors from inside INSURLSessionTaskOperation.
I've tried calling -finishWithError: from inside the completion block of my NSURLSessionTask, but the operation is already completed at that point (due to KVO on the 'state' of the sessionTask).
I think there are two ways we can fix this:
Change the KVO method to call [self finishWithError:self.task] instead of [self finish] when the URLSessionTask completes. This is a simple fix and shouldn't create any timing issues.
OR
Complete the operation only once the completion block on the NSURLSessionTask has finished running. This would allow the user to surface his own errors instead of the URLSession errors.
What do you all think? Have you experienced the same issue?
The text was updated successfully, but these errors were encountered:
Hey everyone!
It seems as though it's currently impossible to surface errors from inside INSURLSessionTaskOperation.
I've tried calling -finishWithError: from inside the completion block of my NSURLSessionTask, but the operation is already completed at that point (due to KVO on the 'state' of the sessionTask).
I think there are two ways we can fix this:
OR
What do you all think? Have you experienced the same issue?
The text was updated successfully, but these errors were encountered: