mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
Fixed: Catch exceptions looking up fingerprints
It's not crucial so if it fails don't take out the whole import process.
This commit is contained in:
parent
2097bfff94
commit
91ddabe5dd
2 changed files with 19 additions and 0 deletions
|
@ -200,5 +200,19 @@ FINGERPRINT=AQAHJlMURlEURcgP6cwRD43Y4Ptw9FowncWPWkf6GB9-JYdP9OgJHw8u4Apw4SsOHMdx
|
|||
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_throw_if_api_times_out()
|
||||
{
|
||||
Mocker.GetMock<IHttpClient>().Setup(x => x.Post<LookupResponse>(It.IsAny<HttpRequest>()))
|
||||
.Throws(new System.Net.WebException("The operation has timed out."));
|
||||
|
||||
var path = Path.Combine(TestContext.CurrentContext.TestDirectory, "Files", "Media", "nin.mp3");
|
||||
var localTrack = new LocalTrack { Path = path };
|
||||
Subject.Lookup(new List<LocalTrack> { localTrack }, 0.5);
|
||||
localTrack.AcoustIdResults.Should().BeNull();
|
||||
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -375,6 +375,11 @@ namespace NzbDrone.Core.Parser
|
|||
_logger.Warn(e, "AcoustId API gave invalid response");
|
||||
return;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.Warn(e, "AcoustId API lookup failed");
|
||||
return;
|
||||
}
|
||||
|
||||
var response = httpResponse.Resource;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue