@@ -706,17 +706,21 @@ def _set_project_platform_if_needed(project: Project, event: Event) -> None:
706
706
if event .platform not in VALID_PLATFORMS or event .get_tag ("sample_event" ) == "yes" :
707
707
return
708
708
709
- updated = Project .objects .filter (
710
- Q (id = project .id ) & (Q (platform__isnull = True ) | Q (platform = "" ))
711
- ).update (platform = event .platform )
712
-
713
- if updated :
714
- create_system_audit_entry (
715
- organization = project .organization ,
716
- target_object = project .id ,
717
- event = audit_log .get_event_id ("PROJECT_EDIT" ),
718
- data = {** project .get_audit_log_data (), "platform" : event .platform },
719
- )
709
+ try :
710
+ updated = Project .objects .filter (
711
+ Q (id = project .id ) & (Q (platform__isnull = True ) | Q (platform = "" ))
712
+ ).update (platform = event .platform )
713
+
714
+ if updated :
715
+ create_system_audit_entry (
716
+ organization = project .organization ,
717
+ target_object = project .id ,
718
+ event = audit_log .get_event_id ("PROJECT_EDIT" ),
719
+ data = {** project .get_audit_log_data (), "platform" : event .platform },
720
+ )
721
+
722
+ except Exception :
723
+ logger .exception ("Failed to infer and set project platform" )
720
724
721
725
722
726
@sentry_sdk .tracing .trace
0 commit comments