Skip to content
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

Have more helpful error text when using bad credentials #353

Open
jspaaks opened this issue Sep 1, 2022 · 0 comments
Open

Have more helpful error text when using bad credentials #353

jspaaks opened this issue Sep 1, 2022 · 0 comments

Comments

@jspaaks
Copy link
Member

jspaaks commented Sep 1, 2022

Currently if you try to run


def get_from_github_with_auth_api(url, apikeys):
    """ """
    headers = {
        "Accept": "application/vnd.github.v3+json"
    }

    username = apikeys.get("github-user")
    key = apikeys.get("github-key")

    return requests.get(url, headers, auth=(username, key), timeout=10)

using bad credentials, the error message is not very helpful. We could update any authenticated calls to make use of the response objects's text or content fields

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant