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

Apply auth error message to 404 responses too. #1052

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Fixed a formatting issue on the new [environment variable section](https://eth-brownie.readthedocs.io/en/stable/config.html?highlight=POSIX-style#variable-expansion) ([#1038](https://github.com/eth-brownie/brownie/pull/1038))
- Adjusted Github API token error message so that it correctly emits when auth failure occurs ([#1052](https://github.com/eth-brownie/brownie/pull/1052))

## [1.14.4](https://github.com/eth-brownie/brownie/tree/v1.14.4) - 2021-04-05
### Added
Expand Down
10 changes: 6 additions & 4 deletions brownie/project/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,10 @@ def _install_from_github(package_id: str) -> str:
msg = "Status {} when getting package versions from Github: '{}'".format(
response.status_code, response.json()["message"]
)
if response.status_code == 403:
if response.status_code in (403, 404):
msg += (
"\n\nIf this issue persists, generate a Github API token and store"
"\n\nMissing or forbidden.\n"
"If this issue persists, generate a Github API token and store"
" it as the environment variable `GITHUB_TOKEN`:\n"
"https://github.blog/2013-05-16-personal-api-tokens/"
)
Expand Down Expand Up @@ -996,10 +997,11 @@ def _get_mix_default_branch(mix_name: str) -> str:
if r.status_code != 200:
status, repo, message = r.status_code, f"brownie-mix/{mix_name}", r.json()["message"]
msg = f"Status {status} when retrieving repo {repo} information from GHAPI: '{message}'"
if r.status_code == 403:
if r.status_code in (403, 404):
msg_lines = (
msg,
"\n\nIf this issue persists, generate a Github API token and store",
"\n\nMissing or forbidden.\n",
"If this issue persists, generate a Github API token and store",
" it as the environment variable `GITHUB_TOKEN`:\n",
"https://github.blog/2013-05-16-personal-api-tokens/",
)
Expand Down