triplea-game / triplea

TripleA is a turn based strategy game and board game engine, similar to Axis & Allies or Risk.
https://triplea-game.org/
GNU General Public License v3.0
1.3k stars 387 forks source link

GameDataManager#loadGame:62 - java.util.zip.ZipException #11257

Open tripleabuilderbot opened 1 year ago

tripleabuilderbot commented 1 year ago

Log Message

Error loading game data

TripleA Version

2.6.14220

Java Version

11.0.9.1

Operating System

Windows 10

Stack Trace

Exception: java.util.zip.ZipException Not in GZIP format
java.lang.Exception
    at java.base/java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:166)
    at java.base/java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:80)
    at java.base/java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:92)
    at games.strategy.engine.framework.GameDataManager.loadGame(GameDataManager.java:62)
    at games.strategy.engine.framework.GameDataManager.loadGame(GameDataManager.java:47)
    at games.strategy.engine.framework.startup.ui.panels.main.game.selector.GameSelectorModel.load(GameSelectorModel.java:76)
    at games.strategy.engine.framework.startup.ui.panels.main.game.selector.GameSelectorPanel.lambda$loadSaveFile$6(GameSelectorPanel.java:370)
    at games.strategy.engine.framework.ui.background.TaskRunner$1.doInBackground(TaskRunner.java:79)
    at games.strategy.engine.framework.ui.background.TaskRunner$1.doInBackground(TaskRunner.java:75)
    at java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:304)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:343)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
asvitkine commented 1 year ago

I think this happens if you try to open some random file with triplea. The code is literally:

      // try to load it as a saved game whatever the extension
      final GameData newData = GameDataManager.loadGame(xmlFile).orElse(null);

So probably a WontFix, but I guess we could try to catch the error and not report it.

frigoref commented 2 weeks ago

@asvitkine Could we flag that as nice to have as this is all to user handling is you and a change would bring little benefit?