Log content on error at ProcessContent
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text;
|
||||
using UmlautAdaptarr.Models;
|
||||
using UmlautAdaptarr.Providers;
|
||||
using UmlautAdaptarr.Services;
|
||||
using UmlautAdaptarr.Utilities;
|
||||
|
||||
namespace UmlautAdaptarr.Controllers
|
||||
{
|
||||
public abstract class SearchControllerBase(ProxyRequestService proxyRequestService, TitleMatchingService titleMatchingService) : ControllerBase
|
||||
public abstract class SearchControllerBase(ProxyRequestService proxyRequestService, TitleMatchingService titleMatchingService, ILogger<SearchControllerBase> logger) : ControllerBase
|
||||
{
|
||||
// TODO evaluate if this should be set to true by default
|
||||
private readonly bool TODO_FORCE_TEXT_SEARCH_ORIGINAL_TITLE = true;
|
||||
@@ -109,9 +110,17 @@ namespace UmlautAdaptarr.Controllers
|
||||
|
||||
|
||||
private string ProcessContent(string content, SearchItem? searchItem)
|
||||
{
|
||||
try
|
||||
{
|
||||
return titleMatchingService.RenameTitlesInContent(content, searchItem);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError($"Error at ProcessContent: {ex.Message}{Environment.NewLine}Content:{Environment.NewLine}{content}");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task<AggregatedSearchResult> AggregateSearchResults(
|
||||
string domain,
|
||||
|
||||
Reference in New Issue
Block a user