Skip to content

Commit 8076832

Browse files
committed
test: exception
1 parent 69269da commit 8076832

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

.github/workflows/run.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
run: |
4040
python telegram/notify.py
4141
42-
- name: Commit and push
43-
run: |
44-
git add .
45-
git commit -m "Successfully run $(date +"%Y-%m-%d %H:%M:%S")"
46-
git push
42+
# - name: Commit and push
43+
# run: |
44+
# git add .
45+
# git commit -m "Successfully run $(date +"%Y-%m-%d %H:%M:%S")"
46+
# git push

telegram/notify.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ def send_tg_notification(message):
4545
# handle response
4646
if response.status == 200 and result.get('ok'):
4747
print("Notification sent successfully", flush=True)
48+
raise Exception("Notification sent successfully")
4849
else:
4950
print(f"Notification sent failed: {response.status} - {data}", flush=True)
50-
51+
raise Exception(f"Notification sent failed: {response.status} - {data}")
5152
except Exception as e:
5253
print(f"Notification sending process error: {str(e)}", flush=True)
5354
finally:

0 commit comments

Comments
 (0)