@@ -73,28 +73,27 @@ func (els *ErrorLogSender) SendErrorLogEvent(initialCloudEvent *cloudevents.Even
7373 return fmt .Errorf ("error retrieving uniform registrations: %w" , err )
7474 }
7575
76- var integrationID string
76+ sendEvent := false
7777 for _ , registration := range registrations {
7878 if registration .Name == els .integrationName {
79- if integrationID != "" {
80- return fmt .Errorf ("found multiple uniform registrations with name %s" , els .integrationName )
79+ errorCloudEvent , err := createErrorLogCloudEvent (registration .ID , initialCloudEvent , applicationError )
80+ if err != nil {
81+ log .Printf ("unable to create error log cloudevent %+v: %+v" , initialCloudEvent , err )
82+ continue
8183 }
82- integrationID = registration .ID
83- }
84- }
8584
86- if integrationID == "" {
87- return fmt .Errorf ("no registration found with name %s" , els .integrationName )
85+ err = els .ceSender .SendCloudEvent (errorCloudEvent )
86+ if err == nil {
87+ sendEvent = true
88+ }
89+ }
8890 }
8991
90- errorCloudEvent , err := createErrorLogCloudEvent (integrationID , initialCloudEvent , applicationError )
91- if err != nil {
92- return fmt .Errorf ("unable to create error log cloudevent: %w" , err )
92+ if sendEvent {
93+ return nil
9394 }
9495
95- els .ceSender .SendCloudEvent (errorCloudEvent )
96-
97- return nil
96+ return fmt .Errorf ("no registration found with name %s" , els .integrationName )
9897}
9998
10099func createErrorLogCloudEvent (
0 commit comments