summaryrefslogtreecommitdiff
path: root/framework
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 /framework
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 'framework')
-rw-r--r--framework/qa/complex/framework/recovery/RecoveryTools.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/framework/qa/complex/framework/recovery/RecoveryTools.java b/framework/qa/complex/framework/recovery/RecoveryTools.java
index 080d84c2fe2c..8a2b03405c96 100644
--- a/framework/qa/complex/framework/recovery/RecoveryTools.java
+++ b/framework/qa/complex/framework/recovery/RecoveryTools.java
@@ -24,11 +24,14 @@ import com.sun.star.awt.XWindow;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
+
import helper.FileTools;
import helper.UnoProvider;
+
import java.io.File;
import java.io.PrintWriter;
import java.util.HashMap;
+
import lib.TestParameters;
import share.LogWriter;
import util.PropertyName;
@@ -155,7 +158,7 @@ public class RecoveryTools {
}
} catch (Exception e){
- throw new com.sun.star.io.IOException("could not remove old recovery data: " + e.toString());
+ throw new com.sun.star.io.IOException("could not remove old recovery data", e);
}
}
@@ -186,7 +189,7 @@ public class RecoveryTools {
return recFiles;
} catch (Exception e){
- throw new com.sun.star.io.IOException("could not get recovery folder: " + e.toString());
+ throw new com.sun.star.io.IOException("could not get recovery folder", e);
}
}
@@ -265,7 +268,7 @@ public class RecoveryTools {
log.println("click ' " + buttonName + "' button..");
oUITools.clickButton(buttonName);
} catch ( java.lang.Exception e){
- throw new com.sun.star.accessibility.IllegalAccessibleComponentStateException("Could not click '"+buttonName +"' at modal dialog: " + e.toString());
+ throw new com.sun.star.accessibility.IllegalAccessibleComponentStateException("Could not click '"+buttonName +"' at modal dialog", e);
}
pause();
}
@@ -285,7 +288,7 @@ public class RecoveryTools {
try{
recFiles = getRecoveryFiles();
} catch ( com.sun.star.io.IOException e){
- throw new com.sun.star.io.IOException("Could not get recovery files: " + e.toString());
+ throw new com.sun.star.io.IOException("Could not get recovery files", e);
}
try{
@@ -307,7 +310,10 @@ public class RecoveryTools {
}
} catch (java.io.IOException e){
- throw new java.io.IOException("Could not copy recovery files: " + e.toString());
+ // the new constructor that takes a Throwable is only available in Java1.6
+ java.io.IOException newEx = new java.io.IOException("Could not copy recovery files");
+ newEx.initCause(e);
+ throw newEx;
}
}