improved error msg

This commit is contained in:
zeroflag 2021-06-27 17:31:31 +02:00
parent 04d4310325
commit a0cc094f05
2 changed files with 4 additions and 1 deletions

View file

@ -1,7 +1,7 @@
package com.vectron.fcl.exceptions; package com.vectron.fcl.exceptions;
public class InterOpFailed extends FclException { public class InterOpFailed extends FclException {
public InterOpFailed(Exception e) { public InterOpFailed(Throwable e) {
super(e); super(e);
} }

View file

@ -9,6 +9,7 @@ import com.vectron.fcl.types.Num;
import com.vectron.fcl.types.Obj; import com.vectron.fcl.types.Obj;
import com.vectron.fcl.types.Str; import com.vectron.fcl.types.Str;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -66,6 +67,8 @@ class MethodSpec {
Object result = method.invoke(receiver, params.toArray(new Object[0])); Object result = method.invoke(receiver, params.toArray(new Object[0]));
if (!method.getReturnType().getSimpleName().equals("void")) if (!method.getReturnType().getSimpleName().equals("void"))
processResult(result, stack); processResult(result, stack);
} catch (InvocationTargetException e) {
throw new InterOpFailed(e.getCause() != null ? e.getCause() : e);
} catch (ReflectiveOperationException e) { } catch (ReflectiveOperationException e) {
throw new InterOpFailed(e); throw new InterOpFailed(e);
} }