.yml config load errors will now show which file failed and why

This commit is contained in:
Toastie 2025-03-19 20:14:40 +13:00
parent b033b062a5
commit eb808d00e5
Signed by: toastie_t0ast
GPG key ID: 0861BE54AD481DC7

View file

@ -74,7 +74,15 @@ public abstract class ConfigServiceBase<TSettings> : IConfigService
Save();
}
data = _serializer.Deserialize<TSettings>(File.ReadAllText(_filePath));
try
{
data = _serializer.Deserialize<TSettings>(File.ReadAllText(_filePath));
}
catch (Exception ex)
{
Log.Error(ex, "Error while loading {ConfigFilePath}", _filePath);
throw;
}
}
/// <summary>