@@ -171,7 +171,7 @@ func (c *writeTarget) Execute(ctx context.Context, request capabilities.Capabili
171171
172172 // Trace the execution
173173 attrs := c .traceAttributes (request .Metadata .WorkflowExecutionID )
174- _ , span := c .beholder .Tracer .Start (ctx , "Execute" , trace .WithAttributes (attrs ... ))
174+ ctx , span := c .beholder .Tracer .Start (ctx , "Execute" , trace .WithAttributes (attrs ... ))
175175 defer span .End ()
176176
177177 // Notice: error skipped as implementation always returns nil
@@ -291,7 +291,15 @@ func (c *writeTarget) Execute(ctx context.Context, request capabilities.Capabili
291291 return capabilities.CapabilityResponse {}, c .asEmittedError (ctx , msg )
292292 }
293293
294- if state != nil {
294+ switch state .Status {
295+ case TransmissionStateNotAttempted :
296+ c .lggr .Debugw ("Transmission not attempted yet, retrying" , "reportID" , info .reportInfo .reportID )
297+ case TransmissionStateFailed :
298+ c .lggr .Debugw ("Tranmissions previously failed, retrying" , "reportID" , info .reportInfo .reportID )
299+ case TransmissionStateFatal :
300+ msg := builder .buildWriteError (info , 0 , "Transmission attempt fatal" , state .Err .Error ())
301+ return capabilities.CapabilityResponse {}, c .asEmittedError (ctx , msg )
302+ case TransmissionStateSucceeded :
295303 // Source the transmitter address from the on-chain state
296304 info .reportTransmissionState = state
297305
0 commit comments