BullOak / BullOak.Repositories.EventStore

The EventStore integration project for BullOak
MIT License
0 stars 8 forks source link

Handle missing event type when loading events #9

Open skleanthous opened 5 years ago

skleanthous commented 5 years ago

BullOak.Repositories.EventStore.Events.ToItemWithType() throws on:

            var serializedEvent = System.Text.Encoding.UTF8.GetString(resolvedEvent.Event.Data);

            Type type = ReadTypeFromMetadata(resolvedEvent);

            object @event;
            if (type.IsInterface) // <-- throws NRE

If the type information is not found, type is null. A specific exception has to be thrown: EventTypeCouldNotBeResolvedException