Skip to content
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
5 changes: 2 additions & 3 deletions src/sentry/notifications/notification_action/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,12 @@


def issue_notification_data_factory(invocation: ActionInvocation) -> IssueNotificationData:
from sentry.notifications.notification_action.types import BaseIssueAlertHandler

action = invocation.action
detector = invocation.detector
event_data = invocation.event_data

rule_instance = BaseIssueAlertHandler.create_rule_instance_from_action(
handler = issue_alert_handler_registry.get(action.type)

Check warning on line 120 in src/sentry/notifications/notification_action/utils.py

View check run for this annotation

@sentry/warden / warden: sentry-backend-bugs

Unhandled NoRegistrationExistsError when looking up issue alert handler

The `issue_notification_data_factory` function calls `issue_alert_handler_registry.get(action.type)` without catching `NoRegistrationExistsError`. If `action.type` is not registered in the issue alert handler registry, this will raise an unhandled exception and crash. Other functions in this same file (`execute_via_issue_alert_handler` at line 76, `execute_via_metric_alert_handler` at line 98) correctly wrap this same registry lookup in try/except. This inconsistency suggests the error handling was overlooked.
rule_instance = handler.create_rule_instance_from_action(
action=action,
detector=detector,
event_data=event_data,
Expand Down
Loading