mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 12:50:38 +08:00
fix: Use checked exception KeyError for missing key
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@ -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 Exception:
|
except KeyError:
|
||||||
s.headers[
|
s.headers[
|
||||||
"Authorization"
|
"Authorization"
|
||||||
] = f'Bearer {get_settings().get("BITBUCKET.BEARER_TOKEN", None)}'
|
] = f'Bearer {get_settings().get("BITBUCKET.BEARER_TOKEN", None)}'
|
||||||
|
Reference in New Issue
Block a user