From 7d88d331bc8226cb08cac1cb850bc51ed0046c69 Mon Sep 17 00:00:00 2001 From: Jonathan Funk Date: Mon, 11 Dec 2023 13:26:10 -0800 Subject: [PATCH] Update worker exception handling --- worker/Program.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/worker/Program.cs b/worker/Program.cs index 9b5fb74d1a..2de669d7d7 100644 --- a/worker/Program.cs +++ b/worker/Program.cs @@ -50,6 +50,13 @@ public static int Main(string[] args) } else { // Normal +1 vote requested + if (vote.vote == "a") { + try{ + throw new Exception($"The Voter {vote.voter_id} failed to have its vote: {vote.vote} processed."); + }catch(Exception ex){ + Console.WriteLine($"Exception Occured During Work: {ex}"); + } + } UpdateVote(pgsql, vote.voter_id, vote.vote); } } @@ -151,4 +158,4 @@ private static void UpdateVote(NpgsqlConnection connection, string voterId, stri } } } -} \ No newline at end of file +}