Fix API break when contents not found#3181
Conversation
Felixoid
left a comment
There was a problem hiding this comment.
Looks good, I'd like to have it merged to have reliable UnknownObjectException
| elif status == 403 and cls.isRateLimitError(message): | ||
| exc = GithubException.RateLimitExceededException | ||
| elif status == 404 and message == "not found": | ||
| elif status == 404 and (message == "not found" or "no object found" in message): |
There was a problem hiding this comment.
| elif status == 404 and (message == "not found" or "no object found" in message): | |
| elif status == 404 and (message == "not found" or "no object found" in message.lower()): |
It will fail for the cases when message is "No object found for the path <path>"
There was a problem hiding this comment.
message is lowercase already, see above, the test uses "No object found ..." and passes.
|
EDIT: Just noticed that the sibling PR is taking this exact route |
|
Will a new tag be released? |
Alternative to #3180 that fixes #3179, but tries to preserve existing behavior.
UnknownObjectException is raised for all kinds of calls that may return a 404, for example get_repo. Those API calls still return a "Not Found" message:
So, in this PR we honor both kinds of messages, but still no other kinds of messages.
Tests are updated to reflect the new case.