Add debugging for issue #149
This commit is contained in:
parent
6ff2859c39
commit
283a46e1e2
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
<Version>6.4.1.1</Version>
|
<Version>6.4.2.1</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -205,8 +205,25 @@ namespace FileManager
|
|||||||
|
|
||||||
private JObject readFile()
|
private JObject readFile()
|
||||||
{
|
{
|
||||||
|
if (!File.Exists(Filepath))
|
||||||
|
{
|
||||||
|
var msg = "Unrecoverable error. Settings file cannot be found";
|
||||||
|
var ex = new FileNotFoundException(msg, Filepath);
|
||||||
|
Serilog.Log.Logger.Error(msg, ex);
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
|
||||||
var settingsJsonContents = File.ReadAllText(Filepath);
|
var settingsJsonContents = File.ReadAllText(Filepath);
|
||||||
var jObject = JsonConvert.DeserializeObject<JObject>(settingsJsonContents);
|
var jObject = JsonConvert.DeserializeObject<JObject>(settingsJsonContents);
|
||||||
|
|
||||||
|
if (jObject is null)
|
||||||
|
{
|
||||||
|
var msg = "Unrecoverable error. Unable to read settings from Settings file";
|
||||||
|
var ex = new NullReferenceException(msg);
|
||||||
|
Serilog.Log.Logger.Error(msg, ex);
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
|
||||||
return jObject;
|
return jObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user