From 75929b8e01e777cb16a5e35db9cedc3cb5483abf Mon Sep 17 00:00:00 2001 From: Andrey Date: Sat, 15 Jun 2024 20:05:47 -0400 Subject: [PATCH] only: better error message --- .../src/main/java/com/opensr5/ini/field/EnumIniField.java | 2 +- .../com/rusefi/tools/tune/WriteSimulatorConfiguration.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/java_console/inifile/src/main/java/com/opensr5/ini/field/EnumIniField.java b/java_console/inifile/src/main/java/com/opensr5/ini/field/EnumIniField.java index e2eb4b5ce5..0c22954639 100644 --- a/java_console/inifile/src/main/java/com/opensr5/ini/field/EnumIniField.java +++ b/java_console/inifile/src/main/java/com/opensr5/ini/field/EnumIniField.java @@ -55,7 +55,7 @@ public class EnumIniField extends IniField { ordinal = getBitRange(ordinal, bitPosition, bitSize0 + 1); if (ordinal >= enums.size()) - throw new IllegalStateException("Ordinal out of range " + ordinal + " in " + getName()); + throw new IllegalStateException("Ordinal out of range " + ordinal + " in " + getName() + " while " + enums.size() + " " + type); return "\"" + enums.get(ordinal) + "\""; } diff --git a/java_tools/tune-tools/src/main/java/com/rusefi/tools/tune/WriteSimulatorConfiguration.java b/java_tools/tune-tools/src/main/java/com/rusefi/tools/tune/WriteSimulatorConfiguration.java index 35f883abe7..ad58232580 100644 --- a/java_tools/tune-tools/src/main/java/com/rusefi/tools/tune/WriteSimulatorConfiguration.java +++ b/java_tools/tune-tools/src/main/java/com/rusefi/tools/tune/WriteSimulatorConfiguration.java @@ -34,7 +34,11 @@ public class WriteSimulatorConfiguration { System.out.println("ROOT_FOLDER=" + ROOT_FOLDER); try { - readBinaryWriteXmlTune(iniFileName, Fields.SIMULATOR_TUNE_BIN_FILE_NAME, TuneCanTool.DEFAULT_TUNE); + try { + readBinaryWriteXmlTune(iniFileName, Fields.SIMULATOR_TUNE_BIN_FILE_NAME, TuneCanTool.DEFAULT_TUNE); + } catch (Throwable e) { + throw new IllegalStateException("White default tune", e); + } for (engine_type_e type : new engine_type_e[]{ // [CannedTunes] see 'rusEfiFunctionalTest.cpp' which exports default tunes into binary files for us // [CannedTunes] TuneCanToolRunner for last third step