better error handling #369

This commit is contained in:
rusefi 2017-03-12 14:20:24 -04:00
parent 39b0c24bf2
commit b776e3fd94
1 changed files with 2 additions and 2 deletions

View File

@ -184,7 +184,7 @@ public abstract class AbstractEvaluator<T> {
System.out.println("doFunction " + function + " " + argCount);
if (function.getMinimumArgumentCount()>argCount || function.getMaximumArgumentCount()<argCount) {
throw new IllegalArgumentException("Invalid argument count for "+function.getName());
throw new IllegalArgumentException("Invalid argument count for "+function.getName() + " while " + argCount);
}
values.push(evaluate(function, getArguments(values, argCount), evaluationContext));
}
@ -306,7 +306,7 @@ public abstract class AbstractEvaluator<T> {
// If the token at the top of the stack is a function token, pop it
// onto the output queue.
int argCount = values.size()-previousValuesSize.pop();
doFunction(values, (Function)stack.pop().getFunction(), argCount, evaluationContext);
doFunction(values, stack.pop().getFunction(), argCount, evaluationContext);
}
} else if (token.isFunctionArgumentSeparator()) {
if (previous==null) {