Skip to content

Commit 31f9e8e

Browse files
committed
If the transform for a source can not be succesfully created from the stream config during a stream config update, return the error rather than merely log it and continue.
Signed-off-by: Jean-Noël Moyne <[email protected]>
1 parent 5749c41 commit 31f9e8e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

server/jetstream_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -23760,5 +23760,6 @@ func TestJetStreamBadSubjectMappingStream(t *testing.T) {
2376023760
},
2376123761
},
2376223762
})
23763-
require_NoError(t, err)
23763+
23764+
require_Error(t, err, NewJSStreamUpdateError(errors.New("unable to get subject transform for source: invalid mapping destination: too many arguments passed to the function in {{wildcard(1)}}{{split(3,1)}}")))
2376423765
}

server/stream.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@ func (mset *stream) updateWithAdvisory(config *StreamConfig, sendAdvisory bool)
18461846
var err error
18471847
si.trs[i], err = NewSubjectTransform(s.SubjectTransforms[i].Source, s.SubjectTransforms[i].Destination)
18481848
if err != nil {
1849-
mset.srv.Errorf("Unable to get subject transform for source: %v", err)
1849+
return fmt.Errorf("unable to get subject transform for source: %v", err)
18501850
}
18511851
}
18521852
}

0 commit comments

Comments
 (0)