public void Handle(NewIncomingEvents message) { foreach (var @event in message.IncomingEvents) { if (this.handlers.ContainsKey(@event.GetType())) { try { this.state = this.handlers[@event.GetType()].Invoke(this.state, @event); this.bus.Publish(new IncomingEventHasBeenProcessed(@event)); } catch (Exception ex) { var wrappedEx = new FatalErrorException($"An error ocurred while handling event of type {@event.GetType()}", ex); this.bus.Publish(new FatalErrorOcurred(wrappedEx)); this.log.Error(wrappedEx, "Query failed"); throw; } } } }
public FatalErrorOcurred(FatalErrorException exception) { this.Exception = exception; }
public void Handle(FatalErrorOcurred message) { this.fatalException = message.Exception; this.systemHaltRequested = true; this.Stop(); }
public FatalErrorOcurred(FatalErrorException exception) { this.Exception = exception; }