Catch any exception, show message in result

This commit is contained in:
Kurt 2020-10-12 10:42:26 -07:00
parent d66c406751
commit 3b4fd49af9

View File

@ -740,10 +740,15 @@ public static bool GetSavesFromFolder(string folderPath, bool deep, out IEnumera
return true;
}
#pragma warning disable CA1031 // Do not catch general exception types
catch (ArgumentException)
catch (Exception ex)
#pragma warning restore CA1031 // Do not catch general exception types
{
result = new[] { MsgFileLoadFailAuto + Environment.NewLine + folderPath, MsgFileLoadFailAutoAdvise + Environment.NewLine + MsgFileLoadFailAutoCause };
result = new[]
{
MsgFileLoadFailAuto + Environment.NewLine + folderPath,
MsgFileLoadFailAutoAdvise + Environment.NewLine + MsgFileLoadFailAutoCause,
ex.Message,
};
return false;
}
}