Log exceptions when getting indexer definitions

Closes #2245
This commit is contained in:
Bogdan 2024-10-08 01:44:36 +03:00
parent 19a9b56fa4
commit cb5764c654

View file

@ -94,8 +94,10 @@ public List<CardigannMetaDefinition> All()
var response = _httpClient.Get<List<CardigannMetaDefinition>>(request);
indexerList = response.Resource.Where(i => !_definitionBlocklist.Contains(i.File)).ToList();
}
catch
catch (Exception ex)
{
_logger.Warn(ex, "Error while getting indexer definitions, fallback to reading from disk.");
var definitionFolder = Path.Combine(_appFolderInfo.AppDataFolder, "Definitions");
indexerList = ReadDefinitionsFromDisk(indexerList, definitionFolder);
@ -106,9 +108,9 @@ public List<CardigannMetaDefinition> All()
indexerList = ReadDefinitionsFromDisk(indexerList, customDefinitionFolder);
}
catch
catch (Exception ex)
{
_logger.Error("Failed to Connect to Indexer Definition Server for Indexer listing");
_logger.Error(ex, "Failed to Connect to Indexer Definition Server for Indexer listing");
}
return indexerList;