-
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
Fix :head option for Pods from HTTP source. #1958
Conversation
I don’t think it should work, as they might then (obviously incorrect anyways) wonder why it doesn’t update. I think that instead the error message should be informative. E.g. (Make the message a bit extra nice, I just quickly typed something ;)) |
True, such an error message would be better. Also a bigger undertaking, because first cocoapods-downloader would need to provide that information. |
We don’t need to modify the exception in if downloader.options_specific?
@specific_source = downloader.checkout_options
else
raise Informative, "Better error message."
end |
OK, will take a stab at that. |
It's not that easy, as |
Ah good point.
While it often is, I’m not sure right now what the best way would be to implement it. So how about rescuing and raising for now and filing a ticket on cocoapods-downloader to allow for nicer error handling? begin
# do work
rescue RuntimeError => e
if e.message == 'Abstract method'
raise Informative, "Does not support #{options}"
else
raise
end
end |
OK, makes sense. In addition to being unclean, it has the disadvantage that it will first download, then fail :) |
Very true, the more reason we should fix this properly. But I do believe that the time it takes for a user to download an archive is nothing compared to the rage unleashed by having to debug ;) |
Sorry for not making this note earlier, but the change also needs an accompanying test case :) Let me know if you need assistance with that. |
Of course I do :). Have added one, probably bad, though, because it will actually hit HTTP? |
Thanks! When I get back, later today, I will update the test to stub it so it doesn't actually try to download. And finally, can you also add a CHANGELOG entry to credit yourself? |
Updated CHANGELOG in #1972 |
OK, figured out how to do that myself :) |
Perfect, thanks! (I amended the patch slightly because it was clashing with another change that cleans a dir when an error occurs.) |
👍 |
HTTP doesn't implement
checkout_options
.While specifying :head for Pods from HTTP sources doesn't really make sense, it feels like it should still work so that the author of a
Podfile
doesn't have to know about the download source of each Pod he uses.