From dc855c6e9ff3968d1f228971bfbfb1636b2632ad Mon Sep 17 00:00:00 2001 From: RaiMan Date: Wed, 11 Jul 2018 10:18:11 +0200 Subject: [PATCH] fixed: imagefile missing: aborting should report the failing line in Java programs too --- API/src/main/java/org/sikuli/script/RunTime.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/API/src/main/java/org/sikuli/script/RunTime.java b/API/src/main/java/org/sikuli/script/RunTime.java index 2877a7094..2b6aeb15e 100644 --- a/API/src/main/java/org/sikuli/script/RunTime.java +++ b/API/src/main/java/org/sikuli/script/RunTime.java @@ -61,12 +61,15 @@ public static void pause(float time) { protected void abortScripting(String msg1, String msg2) { Thread current = Thread.currentThread(); - String where = "unknown"; + String where = ""; if (Region.runTime.isJythonReady) { where = JythonHelper.get().getCurrentLine(); + log(-1, msg2); + log(-1, msg1 + " %s", where); + } + if (where.isEmpty()) { + throw new RuntimeException(msg2); } - log(-1, msg1 + " %s", where); - log(-1, msg2); current.interrupt(); current.stop(); }