mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-12 08:07:10 -07:00
log newsnab 429 errors as warn instead of exceptions
This commit is contained in:
parent
7b2e3ef0c4
commit
a44be4d902
8 changed files with 66 additions and 53 deletions
|
@ -50,13 +50,14 @@ namespace NzbDrone.Common.Test.Http
|
|||
[TestCase(HttpStatusCode.InternalServerError)]
|
||||
[TestCase(HttpStatusCode.ServiceUnavailable)]
|
||||
[TestCase(HttpStatusCode.BadGateway)]
|
||||
public void should_throw_on_unsuccessful_status_codes(HttpStatusCode statusCode)
|
||||
[TestCase(429)]
|
||||
public void should_throw_on_unsuccessful_status_codes(int statusCode)
|
||||
{
|
||||
var request = new HttpRequest("http://eu.httpbin.org/status/" + (int)statusCode);
|
||||
var request = new HttpRequest("http://eu.httpbin.org/status/" + statusCode);
|
||||
|
||||
var exception = Assert.Throws<HttpException>(() => Subject.Get<HttpBinResource>(request));
|
||||
|
||||
exception.Response.StatusCode.Should().Be(statusCode);
|
||||
((int)exception.Response.StatusCode).Should().Be(statusCode);
|
||||
|
||||
ExceptionVerification.IgnoreWarns();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue