diff --git a/Newsbot.Collector.Services/Notifications/Discord/DiscordWebhookClient.cs b/Newsbot.Collector.Services/Notifications/Discord/DiscordWebhookClient.cs index 015fb2b..8559a71 100644 --- a/Newsbot.Collector.Services/Notifications/Discord/DiscordWebhookClient.cs +++ b/Newsbot.Collector.Services/Notifications/Discord/DiscordWebhookClient.cs @@ -37,7 +37,13 @@ public class DiscordWebhookClient : IDiscordNotificatioClient // can be 204 or a message, might be 200 Console.WriteLine(resp.Result.StatusCode); if (resp.Result.StatusCode != HttpStatusCode.NoContent) + { throw new Exception("Message was not accepted by the sever."); + } + if (resp.Result.StatusCode == HttpStatusCode.BadRequest) + { + throw new Exception("Message was not accepted. Make sure all values are not null"); + } } } } \ No newline at end of file