better error handling
This commit is contained in:
parent
319abc861e
commit
bf8184498d
|
@ -45,7 +45,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
||||||
* @see EngineSnifferPanel
|
* @see EngineSnifferPanel
|
||||||
*/
|
*/
|
||||||
public class Launcher {
|
public class Launcher {
|
||||||
public static final int CONSOLE_VERSION = 20180125;
|
public static final int CONSOLE_VERSION = 20180130;
|
||||||
public static final boolean SHOW_STIMULATOR = false;
|
public static final boolean SHOW_STIMULATOR = false;
|
||||||
private static final String TAB_INDEX = "main_tab";
|
private static final String TAB_INDEX = "main_tab";
|
||||||
protected static final String PORT_KEY = "port";
|
protected static final String PORT_KEY = "port";
|
||||||
|
|
|
@ -101,8 +101,10 @@ public class FormulasPane {
|
||||||
|
|
||||||
int algorithm = ConfigField.getIntValue(ci, Fields.FUELALGORITHM);
|
int algorithm = ConfigField.getIntValue(ci, Fields.FUELALGORITHM);
|
||||||
engine_load_mode_e[] values = engine_load_mode_e.values();
|
engine_load_mode_e[] values = engine_load_mode_e.values();
|
||||||
if (algorithm >= values.length)
|
if (algorithm >= values.length) {
|
||||||
throw new IllegalStateException("Unexpected "+ algorithm);
|
FileLog.MAIN.logLine("Invalid algorithm" + algorithm);
|
||||||
|
algorithm = 0; // we are here for example in case of an invalid/incompatible configuration
|
||||||
|
}
|
||||||
engine_load_mode_e algo = values[algorithm];
|
engine_load_mode_e algo = values[algorithm];
|
||||||
|
|
||||||
String acceleration = getAccelerationVariables(ci) + NL2;
|
String acceleration = getAccelerationVariables(ci) + NL2;
|
||||||
|
|
Loading…
Reference in New Issue