File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -128,11 +128,22 @@ func (a *AggregateProjector) processNotification(
128128 notification * ProjectionNotification ,
129129 queue ProjectionTrigger ,
130130) error {
131- var err error
131+ var (
132+ err error
133+ logFields func (e goengine.LoggerEntry )
134+ )
132135 if notification != nil {
133136 err = a .executor .Execute (ctx , notification )
137+ logFields = func (e goengine.LoggerEntry ) {
138+ e .Error (err )
139+ e .Int64 ("notification.no" , notification .No )
140+ e .String ("notification.aggregate_id" , notification .AggregateID )
141+ }
134142 } else {
135143 err = a .triggerOutOfSyncProjections (ctx , queue )
144+ logFields = func (e goengine.LoggerEntry ) {
145+ e .Error (err )
146+ }
136147 }
137148
138149 // No error occurred during projection so return
@@ -141,11 +152,6 @@ func (a *AggregateProjector) processNotification(
141152 }
142153
143154 // Resolve the action to take based on the error that occurred
144- logFields := func (e goengine.LoggerEntry ) {
145- e .Error (err )
146- e .Int64 ("notification.no" , notification .No )
147- e .String ("notification.aggregate_id" , notification .AggregateID )
148- }
149155 switch resolveErrorAction (a .projectionErrorHandler , notification , err ) {
150156 case errorFail :
151157 a .logger .Debug ("ProcessHandler->ErrorHandler: marking projection as failed" , logFields )
Original file line number Diff line number Diff line change 33package mocks
44
55import (
6- _ "github.com/golang/mock/mockgen/model "
6+ _ "github.com/golang/mock/mockgen"
77)
You can’t perform that action at this time.
0 commit comments