catching another http error code. (#19)

This commit is contained in:
James Tombleson 2023-04-02 08:03:59 -07:00 committed by GitHub
parent f1f0e50098
commit d23019926b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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");
}
}
}
}