From 83636d2c09802aeeb1b30078022d228d04da21eb Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 15 Aug 2014 16:17:25 +0200 Subject: 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 --- qadevOOo/runner/lib/StatusException.java | 8 ++++++++ qadevOOo/runner/util/UITools.java | 2 +- qadevOOo/runner/util/utils.java | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'qadevOOo/runner') 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 @@ -40,6 +40,14 @@ public class StatusException extends RuntimeException { status = Status.exception( t ); } + /** + * Constructs a StatusException containing an exception Status. + */ + public StatusException( Throwable t, Status st ) { + super( t ); + this.status = st; + } + /** * Creates a StatusException containing a Status. */ 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); } } -- cgit