moved exception handler, fixes #861

This commit is contained in:
gnembon committed 2021-05-14 03:34:19 -03:00
1 parent 5da6c2837a
commit fd492f334c
1 file changed
+26 -24
+26 -24
View File
@@ -166,34 +166,36 @@ public abstract class Fluff
@Override @Override
public LazyValue lazyEval(Context cc, Context.Type type, Expression e, Tokenizer.Token t, final List<LazyValue> lazyParams) public LazyValue lazyEval(Context cc, Context.Type type, Expression e, Tokenizer.Token t, final List<LazyValue> lazyParams)
{ {
try
{
return new LazyValue()
{ // eager evaluation always ignores the required type and evals params by none default
private List<Value> params;
public Value evalValue(Context c, Context.Type type) { return new LazyValue()
ILazyFunction.checkInterrupts(); { // eager evaluation always ignores the required type and evals params by none default
private List<Value> params;
public Value evalValue(Context c, Context.Type type)
{
ILazyFunction.checkInterrupts();
try
{
return AbstractFunction.this.eval(getParams(c)); return AbstractFunction.this.eval(getParams(c));
} }
catch (RuntimeException exc)
private List<Value> getParams(Context c) { {
if (params == null) { throw Expression.handleCodeException(cc, exc, e, t);
// very likely needs to be dynamic, so not static like here, or remember if it was.
params = unpackArgs(lazyParams, c, Context.Type.NONE);
}
else
{
CarpetSettings.LOG.error("How did we get here 1");
}
return params;
} }
}; }
} private List<Value> getParams(Context c)
catch (RuntimeException exc) {
{ if (params == null)
throw Expression.handleCodeException(cc, exc, e, t); {
} // very likely needs to be dynamic, so not static like here, or remember if it was.
params = unpackArgs(lazyParams, c, Context.Type.NONE);
}
else
{
CarpetSettings.LOG.error("How did we get here 1");
}
return params;
}
};
} }
} }