Skip to content

Commit 443e92b

Browse files
committed
avoid exception when unauthorized
1 parent de8cf47 commit 443e92b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

changelog.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def main(vrn, d):
2727

2828
def gen_log(prompt):
2929

30+
log = "Failed to generated changelog. Ensure that API key is valid."
3031
auth = os.environ.get('LLM_JWT')
3132
if auth:
3233
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {auth}"}
@@ -48,7 +49,7 @@ def gen_log(prompt):
4849
log = re.sub(r"^Let me know.*\n?", '', log, flags=re.MULTILINE)
4950
except Exception as e:
5051
print(
51-
f"Failed to generate changelog. Error: {type(e)} {e} {r}")
52+
f"{log}. Error: {type(e)} {e} {r}")
5253
else:
5354
log = "No auth token"
5455

0 commit comments

Comments
 (0)