Skip to content

Commit

Permalink
If the transform for a source can not be succesfully created from the…
Browse files Browse the repository at this point in the history
… 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]>
  • Loading branch information
jnmoyne committed Jun 20, 2024
1 parent 5749c41 commit 31f9e8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion server/jetstream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23760,5 +23760,6 @@ func TestJetStreamBadSubjectMappingStream(t *testing.T) {
},
},
})
require_NoError(t, err)

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)}}")))
}
2 changes: 1 addition & 1 deletion server/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -1846,7 +1846,7 @@ func (mset *stream) updateWithAdvisory(config *StreamConfig, sendAdvisory bool)
var err error
si.trs[i], err = NewSubjectTransform(s.SubjectTransforms[i].Source, s.SubjectTransforms[i].Destination)
if err != nil {
mset.srv.Errorf("Unable to get subject transform for source: %v", err)
return fmt.Errorf("unable to get subject transform for source: %v", err)
}
}
}
Expand Down

0 comments on commit 31f9e8e

Please sign in to comment.