From 4a36557714214386c674f948410ed2f389c1f539 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 6 Aug 2025 00:56:20 +0800 Subject: [PATCH] :loud_sound: More detail question type validation --- DysonNetwork.Sphere/Poll/PollService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DysonNetwork.Sphere/Poll/PollService.cs b/DysonNetwork.Sphere/Poll/PollService.cs index e1ddb42..61566cd 100644 --- a/DysonNetwork.Sphere/Poll/PollService.cs +++ b/DysonNetwork.Sphere/Poll/PollService.cs @@ -95,7 +95,7 @@ public class PollService(AppDatabase db, ICacheService cache) answer[questionId].ValueKind != JsonValueKind.False: throw new Exception($"Answer for question {question.Title} expected to be a boolean"); default: - throw new ArgumentOutOfRangeException("Question type is not supported: " + question.Type); + throw new ArgumentOutOfRangeException($"Question type is not supported: {question.Type} {answer[questionId].ValueKind}"); } } } @@ -312,4 +312,4 @@ public class PollService(AppDatabase db, ICacheService cache) pollWithStats.UserAnswer = await GetPollAnswer(poll.Id, accountId.Value); return new PollEmbed { Id = poll.Id, Poll = pollWithStats }; } -} \ No newline at end of file +}