mirror of https://github.com/Jackett/Jackett
Improve error handling on corrupt indexer config files (#624)
This commit is contained in:
parent
4074ae197b
commit
8c1086719d
|
@ -46,10 +46,10 @@ namespace Jackett.Services
|
||||||
var configFilePath = GetIndexerConfigFilePath(idx);
|
var configFilePath = GetIndexerConfigFilePath(idx);
|
||||||
if (File.Exists(configFilePath))
|
if (File.Exists(configFilePath))
|
||||||
{
|
{
|
||||||
var fileStr = File.ReadAllText(configFilePath);
|
|
||||||
var jsonString = JToken.Parse(fileStr);
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
var fileStr = File.ReadAllText(configFilePath);
|
||||||
|
var jsonString = JToken.Parse(fileStr);
|
||||||
idx.LoadFromSavedConfiguration(jsonString);
|
idx.LoadFromSavedConfiguration(jsonString);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
Loading…
Reference in New Issue