Open timfel opened 1 year ago
Context ctx = Context.newBuilder("python").allowAllAccess(true).build(); try { ctx.eval("python", "import java; java.math.BigInteger.ONE.divide(java.math.BigInteger.ZERO)"); } catch (Exception e) { }
This prints the zero division exception from Java via https://github.com/oracle/graalpython/blob/master/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/exception/TopLevelExceptionHandler.java#L217. This should be guarded by something like https://github.com/oracle/graalpython/blob/master/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/exception/TopLevelExceptionHandler.java#L182 and then also print to getContext().getEnv().err()
getContext().getEnv().err()
This prints the zero division exception from Java via https://github.com/oracle/graalpython/blob/master/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/exception/TopLevelExceptionHandler.java#L217. This should be guarded by something like https://github.com/oracle/graalpython/blob/master/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/exception/TopLevelExceptionHandler.java#L182 and then also print to
getContext().getEnv().err()