mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Add try-catch for File.copy
This commit is contained in:
parent
cfece3f1b9
commit
a1e3e7b251
@ -49,7 +49,14 @@ namespace Bloxstrap
|
|||||||
Frontend.ShowMessageBox($"{message}\n\n{ex.Message}", System.Windows.MessageBoxImage.Warning);
|
Frontend.ShowMessageBox($"{message}\n\n{ex.Message}", System.Windows.MessageBoxImage.Warning);
|
||||||
|
|
||||||
// Create a backup of loaded file
|
// Create a backup of loaded file
|
||||||
File.Copy(FileLocation, FileLocation + ".bak");
|
try
|
||||||
|
{
|
||||||
|
File.Copy(FileLocation, FileLocation + ".bak");
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
App.Logger.WriteLine(LOG_IDENT, "Backup file attempted to be created but failed. Please create a issue.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Save();
|
Save();
|
||||||
|
Loading…
Reference in New Issue
Block a user