Expected Behavior
- When retrieving a file that is not found, I expect a
UnknownObjectException to be raised.
Actual Behavior
- A GithubException is raised instead, because the error message is being explicitly checked here:
|
elif status == 404 and message == "not found": |
The message is now verbose and references the missing object, instead of "not found".
This caused us to fail to catch an acceptable 404 and broke some things for us.
Workaround
# Before
except UnknownObjectException:
# handle error
# After
except GithubException as e:
if e.status != 404:
raise e
# handle error