diff --git a/ev.go b/ev.go index 6898879..ff419c2 100644 --- a/ev.go +++ b/ev.go @@ -335,7 +335,7 @@ func Create[A any, T PA[A]](ctx context.Context, es *EventStore, streamID string attribute.String("agg.streamID", streamID), ) - if err = es.Load(ctx, agg); err != nil { + if err = es.Load(ctx, agg); err != nil && !errors.Is(err, ErrNotFound){ return } diff --git a/ev_test.go b/ev_test.go index 91a9030..627d8f4 100644 --- a/ev_test.go +++ b/ev_test.go @@ -94,7 +94,7 @@ func TestES(t *testing.T) { thing := &Thing{Name: "time"} err = store.Load(ctx, thing) - is.NoErr(err) + is.True(errors.Is(err, ev.ErrNotFound)) t.Log(thing.StreamVersion(), thing.Name, thing.Value)