catching another http error code. (#19)
This commit is contained in:
parent
f1f0e50098
commit
d23019926b
@ -37,7 +37,13 @@ public class DiscordWebhookClient : IDiscordNotificatioClient
|
|||||||
// can be 204 or a message, might be 200
|
// can be 204 or a message, might be 200
|
||||||
Console.WriteLine(resp.Result.StatusCode);
|
Console.WriteLine(resp.Result.StatusCode);
|
||||||
if (resp.Result.StatusCode != HttpStatusCode.NoContent)
|
if (resp.Result.StatusCode != HttpStatusCode.NoContent)
|
||||||
|
{
|
||||||
throw new Exception("Message was not accepted by the sever.");
|
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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user