fix: Revert back to exception since context.get will not throw KeyError

This commit is contained in:
Luca Simone
2023-11-17 10:08:40 +01:00
parent 26dc2e9d21
commit b62e0967d5

View File

@ -23,7 +23,7 @@ class BitbucketServerProvider(GitProvider):
try: try:
bearer = context.get("bitbucket_bearer_token", None) bearer = context.get("bitbucket_bearer_token", None)
s.headers["Authorization"] = f"Bearer {bearer}" s.headers["Authorization"] = f"Bearer {bearer}"
except KeyError: except Exception:
s.headers[ s.headers[
"Authorization" "Authorization"
] = f'Bearer {get_settings().get("BITBUCKET.BEARER_TOKEN", None)}' ] = f'Bearer {get_settings().get("BITBUCKET.BEARER_TOKEN", None)}'