]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/utils/ValueFromMethod.java
Minor SCL enhancements and fixes for logging and test executing
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / internal / codegen / utils / ValueFromMethod.java
index 4efd2a8d404e7037925fd7d005d782e1fa5c8d3f..70160dee2615b4e284e637134b1efcf7e03e84a5 100644 (file)
@@ -1,5 +1,6 @@
 package org.simantics.scl.compiler.internal.codegen.utils;
 
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
 import org.simantics.scl.runtime.function.FunctionImpl1;
@@ -26,6 +27,8 @@ public class ValueFromMethod {
                 Object ret = method.invoke(null, p0);
                 return returnsVoid ? Tuple0.INSTANCE : ret;
             } catch (ReflectiveOperationException e) {
+                if (e instanceof InvocationTargetException)
+                    throw new RuntimeException(e.getCause());
                 throw new RuntimeException(e);
             }
         }