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,8 +49,15 @@ namespace Bloxstrap
|
||||
Frontend.ShowMessageBox($"{message}\n\n{ex.Message}", System.Windows.MessageBoxImage.Warning);
|
||||
|
||||
// Create a backup of loaded file
|
||||
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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user