|
16 | 16 | from sentry.notifications.types import TEST_NOTIFICATION_ID
|
17 | 17 | from sentry.rules.processing.processor import activate_downstream_actions
|
18 | 18 | from sentry.services.eventstore.models import GroupEvent
|
19 |
| -from sentry.shared_integrations.exceptions import IntegrationFormError |
| 19 | +from sentry.shared_integrations.exceptions import ( |
| 20 | + IntegrationConfigurationError, |
| 21 | + IntegrationFormError, |
| 22 | +) |
20 | 23 | from sentry.utils.samples import create_sample_event
|
21 | 24 | from sentry.workflow_engine.endpoints.utils.test_fire_action import test_fire_action
|
22 | 25 | from sentry.workflow_engine.migration_helpers.rule_action import (
|
|
27 | 30 |
|
28 | 31 | logger = logging.getLogger(__name__)
|
29 | 32 |
|
| 33 | +REPORTABLE_ERROR_TYPES = (IntegrationFormError, IntegrationConfigurationError) |
| 34 | + |
30 | 35 |
|
31 | 36 | @region_silo_endpoint
|
32 | 37 | class ProjectRuleActionsEndpoint(ProjectEndpoint):
|
@@ -109,7 +114,7 @@ def execute_future_on_test_event(
|
109 | 114 |
|
110 | 115 | # safe_execute logs these as exceptions, which can result in
|
111 | 116 | # noisy sentry issues, so log with a warning instead.
|
112 |
| - if isinstance(exc, IntegrationFormError): |
| 117 | + if isinstance(exc, REPORTABLE_ERROR_TYPES): |
113 | 118 | logger.warning(
|
114 | 119 | "%s.test_alert.integration_error", callback_name, extra={"exc": exc}
|
115 | 120 | )
|
@@ -177,9 +182,12 @@ def execute_future_on_test_event_workflow_engine(
|
177 | 182 | action.id = TEST_NOTIFICATION_ID
|
178 | 183 | # Annotate the action with the workflow id
|
179 | 184 | setattr(action, "workflow_id", workflow.id)
|
180 |
| - except Exception as e: |
| 185 | + except REPORTABLE_ERROR_TYPES as e: |
181 | 186 | action_exceptions.append(str(e))
|
182 |
| - sentry_sdk.capture_exception(e) |
| 187 | + continue |
| 188 | + except Exception as e: |
| 189 | + error_id = sentry_sdk.capture_exception(e) |
| 190 | + action_exceptions.append(f"An unexpected error occurred. Error ID: '{error_id}'") |
183 | 191 | continue
|
184 | 192 |
|
185 | 193 | action_exceptions.extend(test_fire_action(action, event_data, detector))
|
|
0 commit comments