Skip to content

Error handling #75

@mattjmorrison

Description

@mattjmorrison

I just ran into this... I got rate limited and the error message seemed fairly cryptic (since it essentially failed silently)

o = Octokit(auth='token', token="mykey")
repo = o.repos.get(owner="myowner", repo="myrepo")
repo.response # is <class 'octokit.ResponseData'>
repo.response.message # is "API rate limit exceeded for user ID XXXXX"

In my case what ended up happening was that I was trying to do something like

o = Octokit(auth='token', token="mykey")
repo = o.repos.get(owner="myowner", repo="myrepo")
repo.response.name # do something with this...

and I ended up getting an AttributeError

AttributeError: type object 'ResponseData' has no attribute 'name'

I'm not sure exactly what the behavior should be.... I assume there should be some exceptions raised in there when non-successful status codes are encountered... maybe? Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions