You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2020/07/17 11:39:16 UTC

[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #2261: Improve GraalVM script engines interoperability.

JaroslavTulach commented on a change in pull request #2261:
URL: https://github.com/apache/netbeans/pull/2261#discussion_r456386921



##########
File path: ide/libs.graalsdk/src/org/netbeans/libs/graalsdk/impl/GraalEngine.java
##########
@@ -55,20 +57,32 @@ public Object eval(String src, ScriptContext arg1) throws ScriptException {
         Value result = evalImpl(arg1, src);
         return unbox(result);
     }
-
-    private Value evalImpl(ScriptContext arg1, String src) throws ScriptException {
-
+    
+    private static interface ScriptAction {
+        public Value run();
+    }
+    
+    private Value handleException(ScriptAction r) throws ScriptException {
         try {
-            return ((GraalContext) arg1).ctx().eval(id(), src);
+            return r.run();
         } catch (PolyglotException e) {
+            if (e.isHostException()) {
+                e.initCause(e.asHostException());

Review comment:
       OK.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists