eventsource
eventsource copied to clipboard
err from loadVersion should not be discarded in Apply
Culprit: https://github.com/altairsix/eventsource/blob/7b6859b7a00908296beea99d5d2800b6c071c084/repository.go#L187
loadVersion can fail for reasons other than "not found", such as "store implementation has connectivity outage" etc. You do not want to discard such errs and fall back on a newly-instantiated empty aggregate here...
A fix to this would do so only for err
s of type eventsource.Error
with a Code()
of eventsource.ErrAggregateNotFound
I reckon? --- with all other err
s being properly returned immediately.