Skip to content

Commit 5146b00

Browse files
committed
2 parents 9072eff + 515787f commit 5146b00

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

src/main/java/JavaFXLibrary.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import javafxlibrary.utils.RobotLog;
2929
import javafxlibrary.utils.TestListener;
3030
import org.apache.commons.io.FileUtils;
31+
import org.python.google.common.base.Throwables;
3132
import org.robotframework.javalib.annotation.Autowired;
3233
import org.robotframework.javalib.library.AnnotationLibrary;
3334
import org.robotframework.remoteserver.RemoteServer;
@@ -74,13 +75,13 @@ public Object runKeyword(String keywordName, Object[] args) {
7475
} catch (RuntimeException e) {
7576
runOnFailure.runOnFailure();
7677
if (e.getCause() instanceof JavaFXLibraryFatalException) {
77-
RobotLog.debug("JavaFXLibrary: Caught JavaFXLibrary FATAL exception");
78+
RobotLog.trace("JavaFXLibrary: Caught JavaFXLibrary FATAL exception: \n" + Throwables.getStackTraceAsString(e));
7879
throw e;
7980
} else if (e.getCause() instanceof JavaFXLibraryNonFatalException) {
80-
RobotLog.debug("JavaFXLibrary: Caught JavaFXLibrary NON-FATAL exception");
81+
RobotLog.trace("JavaFXLibrary: Caught JavaFXLibrary NON-FATAL exception: \n" + Throwables.getStackTraceAsString(e));
8182
throw e;
8283
} else {
83-
RobotLog.debug("JavaFXLibrary: Caught JavaFXLibrary RUNTIME exception");
84+
RobotLog.trace("JavaFXLibrary: Caught JavaFXLibrary RUNTIME exception: \n" + Throwables.getStackTraceAsString(e));
8485
throw e;
8586
}
8687
}

src/main/java/javafxlibrary/keywords/Keywords/BoundsLocation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public Object createBounds(double minX, double minY, double width, double height
5555
} catch (Exception e) {
5656
if ( e instanceof JavaFXLibraryNonFatalException )
5757
throw e;
58-
throw new JavaFXLibraryNonFatalException("Unable to create Bounds object: " + e);
58+
throw new JavaFXLibraryNonFatalException("Unable to create Bounds object: ", e);
5959
}
6060
}
6161

src/main/java/javafxlibrary/keywords/Keywords/ClickRobot.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public FxRobotInterface clickOn(Object locator, String motion) {
5959
return (FxRobotInterface) method.invoke(robot, target, getMotion(motion), new MouseButton[]{MouseButton.PRIMARY});
6060
} catch (IllegalAccessException | InvocationTargetException e) {
6161
throw new JavaFXLibraryNonFatalException("Could not execute click on using locator \"" + locator + "\" " +
62-
"and motion " + motion + ": " + e.getCause().getMessage());
62+
"and motion " + motion + ": " + e.getCause().getMessage(), e);
6363
}
6464
}
6565

@@ -82,7 +82,7 @@ public FxRobotInterface rightClickOn(Object locator, String motion) {
8282
return (FxRobotInterface) method.invoke(robot, target, getMotion(motion));
8383
} catch (IllegalAccessException | InvocationTargetException e) {
8484
throw new JavaFXLibraryNonFatalException("Could not execute right click on using locator \"" + locator + "\" " +
85-
"and motion " + motion + ": " + e.getCause().getMessage());
85+
"and motion " + motion + ": " + e.getCause().getMessage(), e);
8686
}
8787
}
8888

@@ -106,7 +106,7 @@ public FxRobotInterface doubleClickOn(Object locator, String motion) {
106106
return (FxRobotInterface) method.invoke(robot, target, getMotion(motion), new MouseButton[]{MouseButton.PRIMARY});
107107
} catch (IllegalAccessException | InvocationTargetException e) {
108108
throw new JavaFXLibraryNonFatalException("Could not execute double click on using locator \"" + locator + "\" " +
109-
"and motion " + motion + ": " + e.getCause().getMessage());
109+
"and motion " + motion + ": " + e.getCause().getMessage(), e);
110110
}
111111
}
112112

src/main/java/javafxlibrary/keywords/Keywords/DragRobot.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public FxRobotInterface dragFrom(Object locator, String button) {
5353
return (FxRobotInterface) method.invoke(robot, target, new MouseButton[]{MouseButton.valueOf(button)});
5454
} catch (IllegalAccessException | InvocationTargetException e) {
5555
throw new JavaFXLibraryNonFatalException("Could not execute drag from using locator \"" + locator + "\" " +
56-
"and button " + button + ": " + e.getCause().getMessage());
56+
"and button " + button + ": " + e.getCause().getMessage(), e);
5757
}
5858
}
5959

@@ -77,7 +77,7 @@ public FxRobotInterface dropTo(Object locator) {
7777
return (FxRobotInterface) method.invoke(robot, target);
7878
} catch (IllegalAccessException | InvocationTargetException e) {
7979
throw new JavaFXLibraryNonFatalException("Could not execute drop to using locator \"" + locator + "\" " +
80-
": " + e.getCause().getMessage());
80+
": " + e.getCause().getMessage(), e);
8181
}
8282
}
8383

src/main/java/javafxlibrary/keywords/Keywords/MoveRobot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public FxRobotInterface moveTo(Object locator, String motion) {
6060
return (FxRobotInterface) method.invoke(robot, locator, getMotion(motion));
6161
} catch (IllegalAccessException | InvocationTargetException e) {
6262
throw new JavaFXLibraryNonFatalException("Could not execute move to using locator \"" + locator + "\" " +
63-
"and motion " + motion + ": " + e.getCause().getMessage());
63+
"and motion " + motion + ": " + e.getCause().getMessage(), e);
6464
}
6565
}
6666

0 commit comments

Comments
 (0)