New: Link to "Why Searches Could be Failing" wiki section

This commit is contained in:
Bogdan
2024-05-19 18:20:11 +03:00
parent 05d0fe2da6
commit 6b6ff4fe76
3 changed files with 22 additions and 8 deletions
@@ -218,13 +218,12 @@ namespace NzbDrone.Core.MetadataSource.BookInfo
catch (HttpException ex)
{
_logger.Warn(ex, ex.Message);
throw new GoodreadsException("Search for '{0}' failed. Unable to communicate with Goodreads.", title);
throw new GoodreadsException("Search for '{0}' failed. Unable to communicate with Goodreads.", ex, title);
}
catch (Exception ex)
catch (Exception ex) when (ex is not BookInfoException)
{
_logger.Warn(ex, ex.Message);
throw new GoodreadsException("Search for '{0}' failed. Invalid response received from Goodreads.",
title);
throw new GoodreadsException("Search for '{0}' failed. Invalid response received from Goodreads.", ex, title);
}
}
@@ -296,6 +295,11 @@ namespace NzbDrone.Core.MetadataSource.BookInfo
{
return MapSearchResult(ids);
}
catch (HttpException ex)
{
_logger.Warn(ex);
throw new BookInfoException("Search for '{0}' failed. Unable to communicate with ReadarrAPI, returning status code: {1}.", ex, query, ex.Response.StatusCode);
}
catch (Exception e)
{
_logger.Warn(e, "Error mapping search results");
@@ -484,7 +488,7 @@ namespace NzbDrone.Core.MetadataSource.BookInfo
httpRequest.ContentSummary = ids.ToJson(Formatting.None);
httpRequest.AllowAutoRedirect = true;
httpRequest.SuppressHttpError = true;
httpRequest.SuppressHttpErrorStatusCodes = new[] { HttpStatusCode.TooManyRequests };
httpResponse = _httpClient.Post<BulkBookResource>(httpRequest);