summaryrefslogtreecommitdiff
path: root/qadevOOo
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-15 16:17:25 +0200
committerNoel Grandin <noel@peralex.com>2014-09-25 13:47:25 +0200
commit83636d2c09802aeeb1b30078022d228d04da21eb (patch)
tree8a0c619e16c1f6b5388939d5da2956f7ef758c19 /qadevOOo
parentcf49392511e98851174b353782df9eb6bac46f77 (diff)
java: when rethrowing exceptions, store the original cause
so that we get a nice complete stacktrace when it hits the final handler Change-Id: Iec4fcc15a2a25c55f591b5e069dce3d010197a90
Diffstat (limited to 'qadevOOo')
-rw-r--r--qadevOOo/runner/lib/StatusException.java8
-rw-r--r--qadevOOo/runner/util/UITools.java2
-rw-r--r--qadevOOo/runner/util/utils.java4
-rw-r--r--qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java2
-rw-r--r--qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java2
-rw-r--r--qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java2
-rw-r--r--qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java2
7 files changed, 15 insertions, 7 deletions
diff --git a/qadevOOo/runner/lib/StatusException.java b/qadevOOo/runner/lib/StatusException.java
index c9658926bca9..a4bf07f4703f 100644
--- a/qadevOOo/runner/lib/StatusException.java
+++ b/qadevOOo/runner/lib/StatusException.java
@@ -41,6 +41,14 @@ public class StatusException extends RuntimeException {
}
/**
+ * Constructs a StatusException containing an exception Status.
+ */
+ public StatusException( Throwable t, Status st ) {
+ super( t );
+ this.status = st;
+ }
+
+ /**
* Creates a StatusException containing a Status.
*/
public StatusException( Status st ) {
diff --git a/qadevOOo/runner/util/UITools.java b/qadevOOo/runner/util/UITools.java
index d57167cc75bc..3f4701be4823 100644
--- a/qadevOOo/runner/util/UITools.java
+++ b/qadevOOo/runner/util/UITools.java
@@ -257,7 +257,7 @@ public class UITools {
return cMessage;
} catch (Exception e) {
- throw new Exception("Could not get message from Basic-MessageBox: " + e.toString());
+ throw new Exception("Could not get message from Basic-MessageBox:", e);
}
}
diff --git a/qadevOOo/runner/util/utils.java b/qadevOOo/runner/util/utils.java
index 9a3faf4c53cf..775ed23dbe24 100644
--- a/qadevOOo/runner/util/utils.java
+++ b/qadevOOo/runner/util/utils.java
@@ -795,7 +795,7 @@ public class utils {
xContext.getValueByName("/singletons/com.sun.star.util.theMacroExpander"));
return xME.expandMacros(expand);
} catch (Exception e) {
- throw new Exception("could not expand macro: " + e.toString(), e);
+ throw new Exception("could not expand macro", e);
}
}
@@ -848,7 +848,7 @@ public class utils {
utils.shortWait(3000);
} catch (Exception e) {
- throw new Exception("ERROR: could not dispatch URL '" + URL + "': " + e.toString());
+ throw new Exception("ERROR: could not dispatch URL '" + URL + "'", e);
}
}
diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java b/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java
index 9b55bbd2fa18..1703c95d4a5d 100644
--- a/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java
+++ b/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java
@@ -208,7 +208,7 @@ public class DrawController_HandoutView extends TestCase {
utils.dispatchURL(xMSF, xDrawDoc, ".uno:HandoutMode");
} catch (Exception e){
e.printStackTrace(log);
- throw new StatusException(Status.failed(e.toString()));
+ throw new StatusException(e, Status.failed(e.getMessage()));
}
utils.shortWait(500);
diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java b/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java
index 42feb43e810a..65a641d1ddba 100644
--- a/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java
+++ b/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java
@@ -205,7 +205,7 @@ public class DrawController_NotesView extends TestCase {
utils.dispatchURL(xMSF, xDrawDoc, ".uno:NotesMode");
} catch (Exception e){
e.printStackTrace(log);
- throw new StatusException(Status.failed(e.toString()));
+ throw new StatusException(e, Status.failed(e.getMessage()));
}
utils.shortWait(500);
diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java
index f48b6efe51d7..afb690acd572 100644
--- a/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java
+++ b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java
@@ -205,7 +205,7 @@ public class DrawController_OutlineView extends TestCase {
utils.dispatchURL(xMSF, xDrawDoc, ".uno:OutlineMode");
} catch (Exception e){
e.printStackTrace(log);
- throw new StatusException(Status.failed(e.toString()));
+ throw new StatusException(e, Status.failed(e.getMessage()));
}
utils.shortWait(500);
diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java b/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java
index 73780a85681f..5163c4f576a4 100644
--- a/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java
+++ b/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java
@@ -205,7 +205,7 @@ public class DrawController_PresentationView extends TestCase {
utils.dispatchURL(xMSF, xDrawDoc, ".uno:DiaMode");
} catch (Exception e){
e.printStackTrace(log);
- throw new StatusException(Status.failed(e.toString()));
+ throw new StatusException(e, Status.failed(e.getMessage()));
}
utils.shortWait(500);