Skip to content

Commit

Permalink
repository/legacy: log auth failures
Browse files Browse the repository at this point in the history
Resolves: #2576
  • Loading branch information
TimOrme authored Sep 24, 2020
1 parent 3ec2e98 commit ad0cea9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions poetry/repositories/legacy_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,4 +382,10 @@ def _get(self, endpoint): # type: (str) -> Union[Page, None]
except requests.HTTPError as e:
raise RepositoryError(e)

if response.status_code in (401, 403):
self._log(
"Authorization error accessing {url}".format(url=url), level="warn"
)
return

return Page(url, response.content, response.headers)

0 comments on commit ad0cea9

Please sign in to comment.