[sikuli] 271/385: RubyScript: fix exception processing

Gilles Filippini pini at moszumanska.debian.org
Sun Jun 29 19:26:22 UTC 2014


This is an automated email from the git hooks/post-receive script.

pini pushed a commit to tag upstream/1.1.0_beta1
in repository sikuli.

commit ddbf9414580b3e7b11b786df70340e27c3cec2ec
Author: rssdev10 <rssdev10 at gmail.com>
Date:   Sun Feb 23 19:45:43 2014 +0400

    RubyScript: fix exception processing
---
 .../java/org/sikuli/scriptrunner/JRubyScriptRunner.java | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/JRuby/src/main/java/org/sikuli/scriptrunner/JRubyScriptRunner.java b/JRuby/src/main/java/org/sikuli/scriptrunner/JRubyScriptRunner.java
index ab05303..e854494 100755
--- a/JRuby/src/main/java/org/sikuli/scriptrunner/JRubyScriptRunner.java
+++ b/JRuby/src/main/java/org/sikuli/scriptrunner/JRubyScriptRunner.java
@@ -290,7 +290,7 @@ public class JRubyScriptRunner implements IScriptRunner {
 			//(SyntaxError) /tmp/sikuli-3213678404470696048.rb:2: syntax error, unexpected tRCURLY
 
 			Pattern pLineS = Pattern.compile("(?<=:)(\\d+):(.*)");
-			java.util.regex.Matcher mLine = pLineS.matcher(err);
+			Matcher mLine = pLineS.matcher(err);
 			if (mLine.find()) {
 				log(lvl + 2, "SyntaxError error line: " + mLine.group(1));
 				errorText = mLine.group(2) == null ? errorText : mLine.group(2);
@@ -306,7 +306,7 @@ public class JRubyScriptRunner implements IScriptRunner {
 			//(NameError) undefined local variable or method `asdf' for main:Object
 
 			Pattern type = Pattern.compile("(?<=\\()(\\w*)");
-			java.util.regex.Matcher mLine = type.matcher(err);
+			Matcher mLine = type.matcher(err);
 			if (mLine.find()) {
 				errorType = mLine.group(1);
 			}
@@ -319,13 +319,18 @@ public class JRubyScriptRunner implements IScriptRunner {
 					errorLine = line.getLineNumber();
 					errorClass = PY_RUNTIME;
 					this.errorText = thr.getMessage();
-
-					if (errorType.equals("Rukuli::ImageNotFound")) {
-						errorType = "FindFailed";
+                                        
+                                        Pattern sikType = 
+                                                Pattern.compile(
+                                                        "(?<=org.sikuli.script.)(.*)(?=:)");
+                                        Matcher mSikType = 
+                                                sikType.matcher(this.errorText);
+
+					if (mSikType.find()) {
+						errorType = mSikType.group(1);
 					} else if (errorType.equals("RuntimeError")) {
 						errorClass = PY_JAVA;
 					}
-					//errorType = "NameError";
 					break;
 				}
 			}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/sikuli.git



More information about the pkg-java-commits mailing list