-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cancel download task when response status code invalid #985
Cancel download task when response status code invalid #985
Conversation
Thanks for this PR. However, it is not doing the same thing. By calling the completion handler with What's your opinion on it? |
@onevcat Emm, IMO, But if user always wants to get the response data, no matter what error code is, I think he can implement the delegate of |
Hi, @zhongwuzw Yes, a status code could indicate what happens. However, by calling The error handing of Kingfisher is quite old, from the age of Swift 1.x, before |
@onevcat Emm, am I missing something? we call completion handler in place, and in |
@zhongwuzw Maybe you misunderstood me. I mean, if the request fails due to an invalid status code number after we |
@onevcat 🤔 Emm, could you please read the code again to ensure what you want to express? 😂 We call TBO. After this |
No, the error which is passed to users is different. |
Emm, can you show me the code link that I can figure out? Where it would passed to users? Thanks. Sorry I truly can't find any issue like you said. 😢 |
@zhongwuzw Oh, sorry. I think I was wrong with it. You are right, the URL session handler would do nothing since the fetch load happens to be cleared already. It is a bit hidden and more like a side effect. I am not quite like it and it prints out some confusing logs like URL request errored with -999 user-canceled. But you are right, the behavior of Kingfisher does not change for it and it improves since no additional loading required. Thanks for the p-r! |
…-cancellation Cancel download task when response status code invalid
I think we don't need to go on downloading data if the status code is invalid.