Search in sources :

Example 1 with EngineVersionException

use of games.strategy.engine.data.EngineVersionException in project triplea by triplea-game.

the class GameChooserEntry method fullyParseGameData.

public GameData fullyParseGameData() throws GameParseException {
    // TODO: We should be setting this in the the constructor. At this point, you have to call methods in the
    // correct order for things to work, and that is bads.
    gameData = null;
    final Optional<InputStream> inputStream = UrlStreams.openStream(url);
    if (!inputStream.isPresent()) {
        return gameData;
    }
    try (InputStream input = inputStream.get()) {
        gameData = GameParser.parse(url.toString(), input);
        gameDataFullyLoaded = true;
    } catch (final EngineVersionException e) {
        ClientLogger.logQuietly("Game engine not compatible with: " + url, e);
        throw new GameParseException(e);
    } catch (final GameParseException e) {
        ClientLogger.logError("Could not parse:" + url, e);
        throw e;
    } catch (final Exception e) {
        ClientLogger.logError("Could not parse:" + url, e);
        throw new GameParseException(e);
    }
    return gameData;
}
Also used : InputStream(java.io.InputStream) EngineVersionException(games.strategy.engine.data.EngineVersionException) GameParseException(games.strategy.engine.data.GameParseException) GameParseException(games.strategy.engine.data.GameParseException) EngineVersionException(games.strategy.engine.data.EngineVersionException) IOException(java.io.IOException)

Aggregations

EngineVersionException (games.strategy.engine.data.EngineVersionException)1 GameParseException (games.strategy.engine.data.GameParseException)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1