Handle exceptions when saving config files and alert the user

This commit is contained in:
baldurk
2014-06-16 23:11:03 +01:00
parent 71cd654523
commit f0c4cfe51d
+10 -2
View File
@@ -437,8 +437,16 @@ namespace renderdocui.Windows
private void SaveLayout(int layout)
{
string path = GetConfigPath(layout);
Directory.CreateDirectory(Path.GetDirectoryName(path));
dockPanel.SaveAsXml(path, SaveCustomString());
try
{
Directory.CreateDirectory(Path.GetDirectoryName(path));
dockPanel.SaveAsXml(path, SaveCustomString());
}
catch (System.Exception)
{
MessageBox.Show(String.Format("Error saving config file\n{0}\nNo config will be saved out.", path));
}
}
private void LoadSaveLayout(ToolStripItem c, bool save)