3
0

Improve error tracking when error handler is used

This commit is contained in:
Denis Arh
2021-03-22 12:30:30 +01:00
parent 28aa9b3744
commit 664c3c2004
+7 -2
View File
@@ -401,7 +401,12 @@ func (s *Session) worker(ctx context.Context) {
s.execLock <- struct{}{}
go func() {
st.err = s.exec(ctx, st)
err := s.exec(ctx, st)
if err != nil && st.err == nil {
// override the error from the execution
st.err = err
}
st.completed = now()
// remove single
@@ -422,7 +427,7 @@ func (s *Session) worker(ctx context.Context) {
// after exec lock is released call event handler with (new) session status
s.eventHandler(status, st, s)
if st.err != nil {
if err != nil {
// pushing step execution error into error queue
// to break worker loop
s.qErr <- st.err