Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webhook/logging): log response code only if response is not none #3354

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions api/integrations/webhook/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ def __init__(self, config: WebhookConfiguration):

def _identify_user(self, data: typing.Mapping) -> None:
response = call_integration_webhook(self.config, data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what circumstances does call_integration_webhook return None ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, interesting. This solution seems fine for now I guess, but perhaps my original solution was wrong, and we should just try/except the call_integration_webhook function 🤔

logger.debug(
"Sent event to Webhook. Response code was: %s" % response.status_code
)
if response:
logger.debug(
"Sent event to Webhook. Response code was: %s" % response.status_code
)

def generate_user_data(
self,
Expand Down
Loading