fair-software / howfairis

Command line tool to analyze a GitHub or GitLab repository's compliance with the fair-software.eu recommendations
https://pypi.org/project/howfairis/
Apache License 2.0
58 stars 23 forks source link

Have more helpful error text when using bad credentials #353

Open jspaaks opened 2 years ago

jspaaks commented 2 years ago

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