Handles exception when failing to create savefil backups

This commit is contained in:
chardub
2025-03-17 10:37:22 -04:00
parent 455bebbd1b
commit 65d0bcc7c9

View File

@@ -810,6 +810,7 @@ module Game
end
def self.backup_savefile(save_path, slot)
begin
backup_dir = File.join(File.dirname(save_path), "backups")
Dir.mkdir(backup_dir) if !Dir.exist?(backup_dir)
@@ -838,6 +839,10 @@ module Game
excess_backups.each { |old_backup| File.delete(old_backup) }
end
end
rescue => e
echoln ("There was an error while creating a backup savefile.")
echoln("Error: #{e.message}")
end
end
# Saves the game. Returns whether the operation was successful.