Closed dotnetCarpenter closed 7 years ago
Great idea, thanks!
One question, I wonder if the list of error code descriptions is already available somewhere in the standard library? Quick googling turned up this: http://stackoverflow.com/questions/24718557/get-the-description-of-a-status-code-in-python-requests Could we use that instead of maintaining a custom list in the code?
Maintaining... maintaining.. I haven't seen http codes change in my 15 years as a developer but...
Seem that it's no problem getting the http descriptions but there is not way around checking the status code to see if it should be considered an error for github-notifier or it's irrelevant. But the list can be boiled down to 301, 4xx and 5xx. That would reduce the code a little bit.
@abiczo I removed the dictionary object and now use the descriptions from httplib. I also fixed the 301 permanent redirects (it was for http and not https calls) and added a better description (output the offensive URL) in case a 301, 4xx or 5xx status code is found.
What do you think?
Looks great, thank you!
I agree with the author of feedparser, about not changing urls..
Here is my verbose output after this patch:
I'll see if I can find the correct URL's and update this PR.
The HTTP error codes are not complete - I only included the ones that I think could ever matter to a project like github-notifier. So there is more than enough but obviously not all.