Add error recovery around FileLocations.json to handle file corruption

This commit is contained in:
Robert McRackan 2022-02-21 10:24:56 -05:00
parent 0312786721
commit 1e24df626a
2 changed files with 14 additions and 2 deletions

View file

@ -208,7 +208,7 @@ namespace FileManager
{
var msg = "Unrecoverable error. Settings file cannot be found";
var ex = new FileNotFoundException(msg, Filepath);
Serilog.Log.Logger.Error(msg, ex);
Serilog.Log.Logger.Error(ex, msg);
throw ex;
}
@ -226,7 +226,7 @@ namespace FileManager
{
var msg = "Unrecoverable error. Unable to read settings from Settings file";
var ex = new NullReferenceException(msg);
Serilog.Log.Logger.Error(msg, ex);
Serilog.Log.Logger.Error(ex, msg);
throw ex;
}