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: 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 typeeventsource.Error
with aCode()
ofeventsource.ErrAggregateNotFound
I reckon? --- with all othererr
s being properly returned immediately.