mirror of https://github.com/FOME-Tech/fome-fw.git
better error handling #369
This commit is contained in:
parent
6e8b54c7d0
commit
49bdeb0458
|
@ -193,7 +193,7 @@ public abstract class AbstractEvaluator<T> {
|
||||||
// Be aware that arguments are in reverse order on the values stack.
|
// Be aware that arguments are in reverse order on the values stack.
|
||||||
// Don't forget to reorder them in the original order (the one they appear in the evaluated formula)
|
// Don't forget to reorder them in the original order (the one they appear in the evaluated formula)
|
||||||
if (values.size()<nb) {
|
if (values.size()<nb) {
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException("Expected " + nb + " got " + values.size());
|
||||||
}
|
}
|
||||||
LinkedList<T> result = new LinkedList<T>();
|
LinkedList<T> result = new LinkedList<T>();
|
||||||
for (int i = 0; i <nb ; i++) {
|
for (int i = 0; i <nb ; i++) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.rusefi.ui.widgets;
|
package com.rusefi.ui.widgets;
|
||||||
|
|
||||||
import com.fathzer.soft.javaluator.DoubleEvaluator;
|
import com.fathzer.soft.javaluator.DoubleEvaluator;
|
||||||
|
import com.rusefi.FileLog;
|
||||||
import com.rusefi.io.CommandQueue;
|
import com.rusefi.io.CommandQueue;
|
||||||
import com.rusefi.ui.RecentCommands;
|
import com.rusefi.ui.RecentCommands;
|
||||||
import com.rusefi.ui.storage.Node;
|
import com.rusefi.ui.storage.Node;
|
||||||
|
@ -117,6 +118,7 @@ public class AnyCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String prepareCommand(String rawCommand) {
|
public static String prepareCommand(String rawCommand) {
|
||||||
|
try {
|
||||||
if (rawCommand.startsWith("eval ")) {
|
if (rawCommand.startsWith("eval ")) {
|
||||||
return prepareEvalCommand(rawCommand);
|
return prepareEvalCommand(rawCommand);
|
||||||
} else if (rawCommand.startsWith("set_fsio_expression ")) {
|
} else if (rawCommand.startsWith("set_fsio_expression ")) {
|
||||||
|
@ -124,6 +126,10 @@ public class AnyCommand {
|
||||||
} else {
|
} else {
|
||||||
return rawCommand;
|
return rawCommand;
|
||||||
}
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
FileLog.MAIN.log(e);
|
||||||
|
return rawCommand;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String prepareSetFsioCommand(String rawCommand) {
|
private static String prepareSetFsioCommand(String rawCommand) {
|
||||||
|
|
Loading…
Reference in New Issue