Culprit:
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 errs of type eventsource.Error with a Code() of eventsource.ErrAggregateNotFound I reckon? --- with all other errs being properly returned immediately.
Culprit:
eventsource/repository.go
Line 187 in 7b6859b
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
errs of typeeventsource.Errorwith aCode()ofeventsource.ErrAggregateNotFoundI reckon? --- with all othererrs being properly returned immediately.