Skip to content

Commit a8b6930

Browse files
[WEB-5224] chore: raise warning instead of logging an exception for webhook_send_task (#7996)
1 parent 685e3fa commit a8b6930

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

apps/api/plane/bgtasks/webhook_task.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def get_issue_prefetches():
8686
]
8787

8888

89-
9089
def save_webhook_log(
9190
webhook: Webhook,
9291
request_method: str,
@@ -98,10 +97,9 @@ def save_webhook_log(
9897
retry_count: int,
9998
event_type: str,
10099
) -> None:
101-
102100
# webhook_logs
103101
mongo_collection = MongoConnection.get_collection("webhook_logs")
104-
102+
105103
log_data = {
106104
"workspace_id": str(webhook.workspace_id),
107105
"webhook": str(webhook.id),
@@ -123,7 +121,7 @@ def save_webhook_log(
123121
logger.info("Webhook log saved successfully to mongo")
124122
mongo_save_success = True
125123
except Exception as e:
126-
log_exception(e)
124+
log_exception(e, warning=True)
127125
logger.error(f"Failed to save webhook log: {e}")
128126
mongo_save_success = False
129127

@@ -134,7 +132,7 @@ def save_webhook_log(
134132
WebhookLog.objects.create(**log_data)
135133
logger.info("Webhook log saved successfully to database")
136134
except Exception as e:
137-
log_exception(e)
135+
log_exception(e, warning=True)
138136
logger.error(f"Failed to save webhook log: {e}")
139137

140138

@@ -244,7 +242,7 @@ def send_webhook_deactivation_email(webhook_id: str, receiver_id: str, current_s
244242
msg.send()
245243
logger.info("Email sent successfully.")
246244
except Exception as e:
247-
log_exception(e)
245+
log_exception(e, warning=True)
248246
logger.error(f"Failed to send email: {e}")
249247

250248

0 commit comments

Comments
 (0)