Skip to content

Commit

Permalink
Log unknown events instead of throwing exception
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rurounijones committed Jan 29, 2022
1 parent 53cda8d commit 57aabfe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Jupiter.Core/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit 57aabfe

Please sign in to comment.