From 57aabfec77acbfeeeed4980db5899e3bad6148ee Mon Sep 17 00:00:00 2001 From: Jeffrey Jones Date: Sun, 30 Jan 2022 06:52:29 +0900 Subject: [PATCH] Log unknown events instead of throwing exception Log unknown events with a minimal amount of information instead of throwing an exception. Makes the program more reliable even when new ones are added in the DCS-gRPC server. --- Jupiter.Core/ViewModels/MainViewModel.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jupiter.Core/ViewModels/MainViewModel.cs b/Jupiter.Core/ViewModels/MainViewModel.cs index 11832c9..891455b 100644 --- a/Jupiter.Core/ViewModels/MainViewModel.cs +++ b/Jupiter.Core/ViewModels/MainViewModel.cs @@ -271,7 +271,8 @@ public async Task StreamEvents() GameEventCollection.Add(new EventSummary(gameEvent.Time, gameEvent.EventCase.ToString(), gameEvent.MarkRemove.Initiator?.Unit?.PlayerName, gameEvent.MarkRemove.Initiator?.Unit?.Name, gameEvent.ToString())); break; default: - throw new ArgumentOutOfRangeException(); + GameEventCollection.Add(new EventSummary(gameEvent.Time, gameEvent.EventCase.ToString(), "Unknown", "Unknown", "Unknown Event")); + break; } Console.WriteLine(gameEvent.ToString()); }