More info for error log



  • I got this error (tldr i misspelled a territory)

    Oct 06, 2019 1:12:59 PM games.strategy.engine.framework.ui.GameChooserEntry fullyParseGameData
    SEVERE: Could not parse:file:/C:/Users/ckimb/triplea/downloadedMaps/XCOM-master/map/games/XCOM.xml
    games.strategy.engine.data.GameParseException: map name: 'file:/C:/Users/ckimb/triplea/downloadedMaps/XCOM-master/map/games/XCOM.xml', game name: 'XCOM', Unexpected Exception while setting values for attachmentRulesAttachment attached to:PlayerID named:Europeans with name:rulesAttachment
    	at games.strategy.engine.data.GameParser.newGameParseException(GameParser.java:108)
    	at games.strategy.engine.data.GameParser.setValues(GameParser.java:1269)
    	at games.strategy.engine.data.GameParser.parseAttachments(GameParser.java:1219)
    	at games.strategy.engine.data.GameParser.parseMapDetails(GameParser.java:200)
    	at games.strategy.engine.data.GameParser.parse(GameParser.java:97)
    	at games.strategy.engine.data.GameParser.parse(GameParser.java:91)
    	at games.strategy.engine.framework.ui.GameChooserEntry.fullyParseGameData(GameChooserEntry.java:52)
    	at games.strategy.engine.framework.startup.ui.panels.main.game.selector.GameSelectorPanel.lambda$selectGameFile$7(GameSelectorPanel.java:271)
    	at games.strategy.engine.framework.ui.background.BackgroundTaskRunner.lambda$runInBackground$0(BackgroundTaskRunner.java:50)
    	at games.strategy.engine.framework.ui.background.BackgroundTaskRunner$1.doInBackground(BackgroundTaskRunner.java:121)
    	at javax.swing.SwingWorker$1.call(Unknown Source)
    	at java.util.concurrent.FutureTask.run(Unknown Source)
    	at javax.swing.SwingWorker.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.IllegalStateException: No territory called:Hungary-Romanians   for: RulesAttachment attached to:PlayerID named:Europeans with name:rulesAttachment
    	at games.strategy.triplea.attachments.AbstractRulesAttachment.getListedTerritories(AbstractRulesAttachment.java:408)
    	at games.strategy.triplea.attachments.AbstractRulesAttachment.validateNames(AbstractRulesAttachment.java:358)
    	at games.strategy.triplea.attachments.AbstractPlayerRulesAttachment.setMovementRestrictionTerritories(AbstractPlayerRulesAttachment.java:115)
    	at games.strategy.engine.data.MutableProperty.setStringValue(MutableProperty.java:60)
    	at games.strategy.engine.data.MutableProperty.setValue(MutableProperty.java:88)
    	at games.strategy.engine.data.GameParser.setValues(GameParser.java:1265)
    	... 14 more
    
    

    That is at least the fourth territory that I have misspelt. It would be nice if it showed them all at once, instead of having to fix that one, load the map again, fix the next, etc. I had a similar issue with another error, though that one was missing a >, so that might actually break the game's ability to parse it properly.


  • Admin

    @ff03k64 What program are you using to edit the XML? Many programs will do some sort of auto-complete to help minimize typos like that (I use Notepad++).

    But yeah currently the parsing fails immediately at the first error it hits so doesn't see any further errors. Its a fair point but I think would require a fairly large change to force it to parse the entire XML and collect all the errors.


  • Admin

    It's a good change even if a bit painful to code. it's certainly better UX to display all errors in one go rather than just one at a time (https://ux.stackexchange.com/questions/96110/displaying-errors-to-a-user-one-at-a-time-or-all-at-once)



  • And I realize that not all errors will be able to properly get reported one at a time, like the second one i listed. Something might accidentally end up in a comment or something because of the first error.

    I use notepad++, but often there are enough things that are just one letter off, or just different at the end of a name (Romania vs. Romanians) that i just tend to keep typing. Or it isn't showing up in the auto complete because i got the second letter wrong, ... Or ... I might just be lazy sometimes! 🤷🏼♂


Log in to reply