diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-16 12:16:51 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-10-16 12:27:13 +0200 |
commit | 5cba8d44cabc3cbb18648efc9d8658d471b257e7 (patch) | |
tree | 7656e262fcc7b590c2c6a87f966e08956e2f14ec /qadevOOo/runner | |
parent | 25d70197a4e428d1dbde59209505f76d33287416 (diff) |
java: when rethrowing, store the original exception
Change-Id: Idfca83a2a646acab90886c0ef9c30dd7d2fc8b53
Diffstat (limited to 'qadevOOo/runner')
21 files changed, 130 insertions, 153 deletions
diff --git a/qadevOOo/runner/complexlib/Assurance.java b/qadevOOo/runner/complexlib/Assurance.java index 3b4d03a64602..53d287e9dc48 100644 --- a/qadevOOo/runner/complexlib/Assurance.java +++ b/qadevOOo/runner/complexlib/Assurance.java @@ -173,5 +173,8 @@ public class Assurance public AssureException(String msg) { super(msg); } + public AssureException(Throwable cause) { + super(cause); + } } } diff --git a/qadevOOo/runner/convwatch/ConvWatchCancelException.java b/qadevOOo/runner/convwatch/ConvWatchCancelException.java index ad37c2da2a8b..f360293e18f3 100644 --- a/qadevOOo/runner/convwatch/ConvWatchCancelException.java +++ b/qadevOOo/runner/convwatch/ConvWatchCancelException.java @@ -24,4 +24,9 @@ public class ConvWatchCancelException extends ConvWatchException { super(_aMessage); } + + public ConvWatchCancelException(String _aMessage, Throwable cause) + { + super(_aMessage, cause); + } } diff --git a/qadevOOo/runner/convwatch/ConvWatchException.java b/qadevOOo/runner/convwatch/ConvWatchException.java index 28b15121131a..efd1e67e3dc9 100644 --- a/qadevOOo/runner/convwatch/ConvWatchException.java +++ b/qadevOOo/runner/convwatch/ConvWatchException.java @@ -24,5 +24,10 @@ public class ConvWatchException extends Exception { super(_aMessage); } + + public ConvWatchException(String _aMessage, Throwable cause) + { + super(_aMessage, cause); + } } diff --git a/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java b/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java index 2d59022c527d..f9d1e29edbc4 100644 --- a/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java +++ b/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java @@ -279,7 +279,7 @@ public class GraphicalDifferenceCheck catch (com.sun.star.io.IOException e) { // wrap IOException - throw new ConvWatchCancelException("Wrap IOException caught, " + e.getMessage()); + throw new ConvWatchCancelException("Wrap IOException caught", e); } GlobalLogWriter.get().println("Saving XComponent as " + resultURL); diff --git a/qadevOOo/runner/convwatch/MSOfficePrint.java b/qadevOOo/runner/convwatch/MSOfficePrint.java index ba65b5bcf80e..9ed3b4b60727 100644 --- a/qadevOOo/runner/convwatch/MSOfficePrint.java +++ b/qadevOOo/runner/convwatch/MSOfficePrint.java @@ -251,7 +251,7 @@ public class MSOfficePrint } catch (IndexOutOfBoundsException e) { - throw new ConvWatchCancelException/*WrongEnvironmentException*/("Given list is too short."); + throw new ConvWatchCancelException/*WrongEnvironmentException*/("Given list is too short.", e); } // return aHandler.getExitCode(); diff --git a/qadevOOo/runner/convwatch/OfficePrint.java b/qadevOOo/runner/convwatch/OfficePrint.java index cc7867db015e..432620005573 100644 --- a/qadevOOo/runner/convwatch/OfficePrint.java +++ b/qadevOOo/runner/convwatch/OfficePrint.java @@ -767,14 +767,13 @@ public class OfficePrint { } catch(ConvWatchCancelException e) { - e.printStackTrace(); GlobalLogWriter.get().println(e.getMessage()); - throw new ConvWatchCancelException("Exception caught. Problem with MSOffice printer methods."); + throw new ConvWatchCancelException("Exception caught. Problem with MSOffice printer methods.", e); } catch(java.io.IOException e) { GlobalLogWriter.get().println(e.getMessage()); - throw new ConvWatchCancelException("IOException caught. Problem with MSOffice printer methods."); + throw new ConvWatchCancelException("IOException caught. Problem with MSOffice printer methods.", e); } bBack = true; } diff --git a/qadevOOo/runner/convwatch/ReportDesignerTest.java b/qadevOOo/runner/convwatch/ReportDesignerTest.java index 6dd5001c3441..204f8d9c70f3 100644 --- a/qadevOOo/runner/convwatch/ReportDesignerTest.java +++ b/qadevOOo/runner/convwatch/ReportDesignerTest.java @@ -285,7 +285,7 @@ public class ReportDesignerTest extends ComplexTestCase { catch (AssureException e) { stopOffice(); - throw new AssureException(e.getMessage()); + throw new AssureException(e); } // ------------------------------ Office shutdown ------------------------------ diff --git a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java index 6133094ece6d..a5c1667e7eb1 100644 --- a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java +++ b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java @@ -89,14 +89,13 @@ public class MSOfficePostscriptCreator implements IOffice } catch(OfficeException e) { - e.printStackTrace(); GlobalLogWriter.println(e.getMessage()); - throw new OfficeException("Exception caught. Problem with MSOffice printer methods."); + throw new OfficeException("Exception caught. Problem with MSOffice printer methods.", e); } catch(java.io.IOException e) { GlobalLogWriter.println(e.getMessage()); - throw new OfficeException("IOException caught. Problem with MSOffice printer methods."); + throw new OfficeException("IOException caught. Problem with MSOffice printer methods.", e); } } @@ -258,7 +257,7 @@ public class MSOfficePostscriptCreator implements IOffice } catch (IndexOutOfBoundsException e) { - throw new WrongEnvironmentException("Given list is too short."); + throw new WrongEnvironmentException("Given list is too short.", e); } } diff --git a/qadevOOo/runner/graphical/OfficeException.java b/qadevOOo/runner/graphical/OfficeException.java index 1241c1b2db0d..94c0d3ae942c 100644 --- a/qadevOOo/runner/graphical/OfficeException.java +++ b/qadevOOo/runner/graphical/OfficeException.java @@ -28,4 +28,9 @@ public class OfficeException extends Exception { super(_aMessage); } + + public OfficeException(String _aMessage, Throwable cause) + { + super(_aMessage, cause); + } } diff --git a/qadevOOo/runner/graphical/WrongEnvironmentException.java b/qadevOOo/runner/graphical/WrongEnvironmentException.java index 922ee8c6e8e3..fe60de560f27 100644 --- a/qadevOOo/runner/graphical/WrongEnvironmentException.java +++ b/qadevOOo/runner/graphical/WrongEnvironmentException.java @@ -24,4 +24,8 @@ public class WrongEnvironmentException extends OfficeException { super(_aMessage); } + public WrongEnvironmentException(String _aMessage, Throwable cause) + { + super(_aMessage, cause); + } } diff --git a/qadevOOo/runner/helper/ConfigHelper.java b/qadevOOo/runner/helper/ConfigHelper.java index da873a59b97c..cfa61a3bf15a 100644 --- a/qadevOOo/runner/helper/ConfigHelper.java +++ b/qadevOOo/runner/helper/ConfigHelper.java @@ -212,18 +212,18 @@ public class ConfigHelper xProp = UnoRuntime.queryInterface( XPropertySet.class, xSetCont.getByName(groupName)); - } catch (com.sun.star.container.NoSuchElementException e){ - throw new com.sun.star.uno.Exception( + } catch (com.sun.star.container.NoSuchElementException ex){ + throw new com.sun.star.uno.Exception(ex, "could not get group '" + groupName + - "' from set '"+ setName +"':\n" + e.toString()); + "' from set '"+ setName +"'"); } try{ xProp.setPropertyValue(propName, propValue); - } catch (com.sun.star.uno.Exception e) { - throw new com.sun.star.uno.Exception( + } catch (com.sun.star.uno.Exception ex) { + throw new com.sun.star.uno.Exception(ex, "could not set property '" + propName + "' from group '"+ groupName + - "' from set '"+ setName +"':\n" + e.toString()); + "' from set '"+ setName +"'"); } } @@ -255,28 +255,28 @@ public class ConfigHelper Object xGroup=xSetCont.getByName(group); xGroupAccess = UnoRuntime.queryInterface( XNameReplace.class,xGroup); - } catch(com.sun.star.container.NoSuchElementException e) { - throw new com.sun.star.uno.Exception( + } catch(com.sun.star.container.NoSuchElementException ex) { + throw new com.sun.star.uno.Exception(ex, "could not get group '" + group + - "' from set '"+ setName +"':\n" + e.toString()); + "' from set '"+ setName +"'"); } try { Object xGroup=xGroupAccess.getByName(extGroup); xExtGroupCont = UnoRuntime.queryInterface( XNameContainer.class,xGroup); - } catch(com.sun.star.container.NoSuchElementException e) { - throw new com.sun.star.uno.Exception( + } catch(com.sun.star.container.NoSuchElementException ex) { + throw new com.sun.star.uno.Exception(ex, "could not get extensilbe group '"+extGroup+ "' from group '"+ group + - "' from set '"+ setName +"':\n" + e.toString()); + "' from set '"+ setName +"'"); } try { xExtGroupCont.insertByName(propName, propValue); } catch(com.sun.star.container.ElementExistException e) { - xExtGroupCont .replaceByName(propName, propValue); + xExtGroupCont.replaceByName(propName, propValue); } } diff --git a/qadevOOo/runner/helper/StreamSimulator.java b/qadevOOo/runner/helper/StreamSimulator.java index 1b53d4a9a492..7571ce6864cf 100644 --- a/qadevOOo/runner/helper/StreamSimulator.java +++ b/qadevOOo/runner/helper/StreamSimulator.java @@ -106,7 +106,7 @@ public class StreamSimulator implements com.sun.star.io.XInputStream , } catch(com.sun.star.uno.Exception exUno) { - throw new com.sun.star.io.NotConnectedException("Could not open the file."); + throw new com.sun.star.io.NotConnectedException(exUno); } } diff --git a/qadevOOo/runner/util/BasicMacroTools.java b/qadevOOo/runner/util/BasicMacroTools.java index 34407cac336d..0a2a856f774f 100644 --- a/qadevOOo/runner/util/BasicMacroTools.java +++ b/qadevOOo/runner/util/BasicMacroTools.java @@ -47,32 +47,26 @@ public class BasicMacroTools { */ public BasicMacroTools(XMultiServiceFactory msf, XModel xModel, XComponent xDoc) throws java.lang.Exception { - try { - mMSF = msf; - mDispProv = makeDispatchProvider(xModel); - mParser = makeParser(mMSF); + mMSF = msf; + mDispProv = makeDispatchProvider(xModel); + mParser = makeParser(mMSF); - Object DocLibCont = null; + Object DocLibCont = null; - try { - XPropertySet xDocProps = UnoRuntime.queryInterface( - XPropertySet.class, xDoc); - DocLibCont = xDocProps.getPropertyValue("BasicLibraries"); - } catch (com.sun.star.uno.Exception e) { - throw new Exception( - "Couldn't get BasicLibraries-Container from document: " + e.toString()); - } - - mLCxNA = UnoRuntime.queryInterface(XNameAccess.class, - DocLibCont); + try { + XPropertySet xDocProps = UnoRuntime.queryInterface( + XPropertySet.class, xDoc); + DocLibCont = xDocProps.getPropertyValue("BasicLibraries"); + } catch (com.sun.star.uno.Exception e) { + throw new Exception( + "Couldn't get BasicLibraries-Container from document", e); + } - mLCxLC = UnoRuntime.queryInterface( - XLibraryContainer.class, DocLibCont); + mLCxNA = UnoRuntime.queryInterface(XNameAccess.class, + DocLibCont); - } catch (Exception e) { - throw new Exception("could not initialize BasicMacros " + - e.toString()); - } + mLCxLC = UnoRuntime.queryInterface( + XLibraryContainer.class, DocLibCont); } /* @@ -80,31 +74,24 @@ public class BasicMacroTools { */ public BasicMacroTools(XMultiServiceFactory msf, XModel xModel) throws java.lang.Exception { - try { - mMSF = msf; - mDispProv = makeDispatchProvider(xModel); - mParser = makeParser(mMSF); + mMSF = msf; + mDispProv = makeDispatchProvider(xModel); + mParser = makeParser(mMSF); - Object ASLC = null; + Object ASLC = null; - try { - ASLC = mMSF.createInstance( - "com.sun.star.script.ApplicationScriptLibraryContainer"); - } catch (com.sun.star.uno.Exception e) { - throw new Exception( - "Couldn't create ApplicationScriptLibraryContainer" + e.toString()); - } - - mLCxNA = UnoRuntime.queryInterface(XNameAccess.class, - ASLC); + try { + ASLC = mMSF.createInstance( + "com.sun.star.script.ApplicationScriptLibraryContainer"); + } catch (com.sun.star.uno.Exception e) { + throw new Exception("Couldn't create ApplicationScriptLibraryContainer", e); + } - mLCxLC = UnoRuntime.queryInterface( - XLibraryContainer.class, ASLC); + mLCxNA = UnoRuntime.queryInterface(XNameAccess.class, + ASLC); - } catch (Exception e) { - throw new Exception("could not initialize BasicMacros " + - e.toString()); - } + mLCxLC = UnoRuntime.queryInterface( + XLibraryContainer.class, ASLC); } private static XDispatchProvider makeDispatchProvider(XModel aModel) @@ -137,21 +124,15 @@ public class BasicMacroTools { try { appendLibrary(LibraryName, LibraryURL); } catch (java.lang.Exception e) { - e.printStackTrace(); - throw new Exception("ERROR: Could not append Library " + - LibraryName + e.toString()); + throw new Exception("Could not append Library " + LibraryName, e); } try { mLCxLC.loadLibrary(LibraryName); } catch (com.sun.star.container.NoSuchElementException e) { - e.printStackTrace(); - throw new Exception("ERROR: Could not load Library " + - LibraryName + e.toString()); + throw new Exception("Could not load Library " + LibraryName, e); } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace(); - throw new Exception("ERROR: Could not load Library " + - LibraryName + e.toString()); + throw new Exception("Could not load Library " + LibraryName, e); } } @@ -165,13 +146,9 @@ public class BasicMacroTools { try { mLCxLC.createLibraryLink(LibraryName, LibraryURL, false); } catch (com.sun.star.container.ElementExistException e) { - e.printStackTrace(); - throw new Exception("ERROR: Library " + LibraryName + - "already exist." + e.toString()); + throw new Exception("Library " + LibraryName + "already exists.", e); } catch (com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace(); - throw new Exception("Could not link Basic library:" + - LibraryName + e.toString()); + throw new Exception("Could not link Basic library " + LibraryName, e); } } @@ -180,13 +157,9 @@ public class BasicMacroTools { try { mLCxLC.removeLibrary(LibraryName); } catch (com.sun.star.container.NoSuchElementException e) { - e.printStackTrace(); - throw new Exception("Could not remove Basic library:" + - LibraryName + ": Library does not exist" + e.toString()); + throw new Exception("Could not remove Basic library " + LibraryName + ", Library does not exist", e); } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace(); - throw new Exception("Could not remove Basic library:" + - LibraryName + e.toString()); + throw new Exception("Could not remove Basic library " + LibraryName, e); } } } diff --git a/qadevOOo/runner/util/CalcTools.java b/qadevOOo/runner/util/CalcTools.java index dd6defab8050..73f11ba81cf0 100644 --- a/qadevOOo/runner/util/CalcTools.java +++ b/qadevOOo/runner/util/CalcTools.java @@ -34,7 +34,7 @@ import com.sun.star.uno.Type; import com.sun.star.uno.UnoRuntime; /** - * This class contains some useful mathods to handle Calc documents + * This class contains some useful methods to handle Calc documents * and its sheets. */ public class CalcTools { @@ -42,7 +42,7 @@ public class CalcTools { /** * fills a range of a calc sheet with computed data of type * <CODE>Double</CODE>. - * @param xSheetDoc the Clac documents which should be filled + * @param xSheetDoc the Calc documents which should be filled * @param sheetNumber the number of the sheet of <CODE>xSheetDoc</CODE> * @param startCellX the cell number of the X start point (row) of the range to fill * @param startCellY the cell number of the Y start point (column) of the range to fill @@ -53,15 +53,9 @@ public class CalcTools { public static void fillCalcSheetWithContent(XComponent xSheetDoc, int sheetNumber, int startCellX, int startCellY, int rangeLengthX, int rangeLengthY) throws java.lang.Exception { - try{ - XSpreadsheet xSheet = getSpreadSheetFromSheetDoc(xSheetDoc, sheetNumber); - - fillCalcSheetWithContent(xSheet, startCellX, startCellY, rangeLengthX, rangeLengthY); + XSpreadsheet xSheet = getSpreadSheetFromSheetDoc(xSheetDoc, sheetNumber); - } catch (Exception e){ - throw new Exception( - "Couldn't fill CalcSheet with content: " + e.toString()); - } + fillCalcSheetWithContent(xSheet, startCellX, startCellY, rangeLengthX, rangeLengthY); } /** @@ -77,31 +71,24 @@ public class CalcTools { public static void fillCalcSheetWithContent(XSpreadsheet xSheet, int startCellX, int startCellY, int rangeLengthX, int rangeLengthY) throws java.lang.Exception { - - try{ - // create a range with content - Object[][] newData = new Object[rangeLengthY][rangeLengthX]; - for (int i=0; i<rangeLengthY; i++) { - for (int j=0; j<rangeLengthX; j++) { - newData[i][j] = new Double(10*i +j); - } - } - XCellRange xRange = null; - try { - xRange = xSheet.getCellRangeByPosition(startCellX, startCellY, - startCellX+rangeLengthX-1, startCellY+rangeLengthY-1); - } catch ( IndexOutOfBoundsException e){ - throw new Exception( - "Couldn't get CellRange from sheett: " + e.toString()); + // create a range with content + Object[][] newData = new Object[rangeLengthY][rangeLengthX]; + for (int i=0; i<rangeLengthY; i++) { + for (int j=0; j<rangeLengthX; j++) { + newData[i][j] = new Double(10*i +j); } + } + XCellRange xRange = null; + try { + xRange = xSheet.getCellRangeByPosition(startCellX, startCellY, + startCellX+rangeLengthX-1, startCellY+rangeLengthY-1); + } catch ( IndexOutOfBoundsException ex){ + throw new Exception(ex, "Couldn't get CellRange from sheet"); + } - XCellRangeData xRangeData = UnoRuntime.queryInterface(XCellRangeData.class, xRange); + XCellRangeData xRangeData = UnoRuntime.queryInterface(XCellRangeData.class, xRange); - xRangeData.setDataArray(newData); - } catch (Exception e){ - throw new Exception( - "Couldn't fill CalcSheet with content: " + e.toString()); - } + xRangeData.setDataArray(newData); } /** @@ -125,24 +112,16 @@ public class CalcTools { XIndexAccess xSheetsIndexArray = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); - try{ - xSheet = (XSpreadsheet) AnyConverter.toObject( - new Type(XSpreadsheet.class),xSheetsIndexArray.getByIndex(sheetNumber)); + xSheet = (XSpreadsheet) AnyConverter.toObject( + new Type(XSpreadsheet.class),xSheetsIndexArray.getByIndex(sheetNumber)); - } catch (IllegalArgumentException e){ - throw new Exception( - "Couldn't get sheet '" +sheetNumber + "' : " + e.toString()); - } catch (IndexOutOfBoundsException e){ - throw new Exception( - "Couldn't get sheet '" +sheetNumber + "' : " + e.toString()); - } catch (WrappedTargetException e){ - throw new Exception( - "Couldn't get sheet '" +sheetNumber + "' : " + e.toString()); - } - } catch (Exception e){ - throw new Exception( - "Couldn't get sheet '" +sheetNumber + "' : " + e.toString()); + } catch (IllegalArgumentException ex){ + throw new Exception(ex, "Couldn't get sheet '" +sheetNumber + "'"); + } catch (IndexOutOfBoundsException ex){ + throw new Exception(ex, "Couldn't get sheet '" +sheetNumber + "'"); + } catch (WrappedTargetException ex) { + throw new Exception(ex, "Couldn't get sheet '" +sheetNumber + "'"); } - return xSheet; + return xSheet; } } diff --git a/qadevOOo/runner/util/DesktopTools.java b/qadevOOo/runner/util/DesktopTools.java index 646ffcbdce5d..e0cc25f6e746 100644 --- a/qadevOOo/runner/util/DesktopTools.java +++ b/qadevOOo/runner/util/DesktopTools.java @@ -83,7 +83,7 @@ public class DesktopTools } catch (com.sun.star.uno.Exception e) { - throw new IllegalArgumentException("Desktop Service not available"); + throw new IllegalArgumentException("Desktop Service not available", e); } return oInterface; @@ -230,7 +230,7 @@ public class DesktopTools } catch (com.sun.star.uno.Exception e) { - throw new IllegalArgumentException("Document could not be opened"); + throw new IllegalArgumentException("Document could not be opened", e); } return oDoc; @@ -258,7 +258,7 @@ public class DesktopTools } catch (com.sun.star.uno.Exception e) { - throw new IllegalArgumentException("Document could not be loaded"); + throw new IllegalArgumentException("Document could not be loaded", e); } bringWindowToFront(oDoc); diff --git a/qadevOOo/runner/util/DrawTools.java b/qadevOOo/runner/util/DrawTools.java index 5a37f4d1c7d7..a8f416312de3 100644 --- a/qadevOOo/runner/util/DrawTools.java +++ b/qadevOOo/runner/util/DrawTools.java @@ -65,7 +65,7 @@ public class DrawTools { oDPn = oDPS.getDrawPages(); } catch ( Exception e ) { - throw new IllegalArgumentException( "Couldn't get drawpages" ); + throw new IllegalArgumentException( "Couldn't get drawpages", e ); } return oDPn; } // finish getDrawPages @@ -84,7 +84,7 @@ public class DrawTools { oDP = (XDrawPage) AnyConverter.toObject( new Type(XDrawPage.class),getDrawPages( aDoc ).getByIndex( nr )); } catch ( Exception e ) { - throw new IllegalArgumentException( "Couldn't get drawpage" ); + throw new IllegalArgumentException( "Couldn't get drawpage", e ); } return oDP; } diff --git a/qadevOOo/runner/util/FormTools.java b/qadevOOo/runner/util/FormTools.java index bebd3c3ddd2a..c89e41b925dc 100644 --- a/qadevOOo/runner/util/FormTools.java +++ b/qadevOOo/runner/util/FormTools.java @@ -199,7 +199,7 @@ public class FormTools { XForm oForm = UnoRuntime.queryInterface(XForm.class, oControl); Forms.insertByName(aName,oForm); } catch ( Exception e ) { - throw new IllegalArgumentException( "Couldn't insert Form" ); + throw new IllegalArgumentException( "Couldn't insert Form", e ); } } diff --git a/qadevOOo/runner/util/SOfficeFactory.java b/qadevOOo/runner/util/SOfficeFactory.java index f672733a4e97..c45fbd6131e0 100644 --- a/qadevOOo/runner/util/SOfficeFactory.java +++ b/qadevOOo/runner/util/SOfficeFactory.java @@ -50,8 +50,7 @@ public class SOfficeFactory { try { oInterface = xMSF.createInstance("com.sun.star.frame.Desktop"); } catch (com.sun.star.uno.Exception e) { - throw new IllegalArgumentException( - "Desktop Service not available"); + throw new IllegalArgumentException("Desktop Service not available", e); } // query the desktop interface and then it's componentloader diff --git a/qadevOOo/runner/util/UITools.java b/qadevOOo/runner/util/UITools.java index dfff8356910e..f3aea0610dbe 100644 --- a/qadevOOo/runner/util/UITools.java +++ b/qadevOOo/runner/util/UITools.java @@ -143,7 +143,7 @@ public class UITools { oAction.doAccessibleAction(0); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { throw new Exception("Could not do accessible action with '" + - buttonName + "'" + e.toString()); + buttonName + "'", e); } } @@ -193,13 +193,13 @@ public class UITools { } catch (com.sun.star.lang.IndexOutOfBoundsException e) { throw new Exception("Could not get child form list of '" - + ListBoxName + "' : " + e.toString()); + + ListBoxName + "'", e); } } } catch (Exception e) { throw new Exception("Could not get list of items from '" - + ListBoxName + "' : " + e.toString()); + + ListBoxName + "'", e); } String[]ret = new String[Items.size()]; return Items.toArray(ret); @@ -227,7 +227,7 @@ public class UITools { } catch (Exception e) { throw new Exception("Could not set value to CheckBox '" - + CheckBoxName + "' : " + e.toString()); + + CheckBoxName + "'", e); } } diff --git a/qadevOOo/runner/util/WriterTools.java b/qadevOOo/runner/util/WriterTools.java index e7189ebaa5e5..4681a9963235 100644 --- a/qadevOOo/runner/util/WriterTools.java +++ b/qadevOOo/runner/util/WriterTools.java @@ -70,7 +70,7 @@ public class WriterTools { XDrawPageSupplier.class, aDoc); oDP = oDPS.getDrawPage(); } catch (Exception e) { - throw new IllegalArgumentException("Couldn't get drawpage"); + throw new IllegalArgumentException("Couldn't get drawpage", e); } return oDP; diff --git a/qadevOOo/runner/util/compare/GraphicalComparator.java b/qadevOOo/runner/util/compare/GraphicalComparator.java index af0492ddc280..82495a8a9a7d 100644 --- a/qadevOOo/runner/util/compare/GraphicalComparator.java +++ b/qadevOOo/runner/util/compare/GraphicalComparator.java @@ -150,7 +150,9 @@ class GraphicalComparator implements DocComparator catch (ConvWatchException e) { // wrap it to IOException - throw new java.io.IOException(e.getMessage()); + java.io.IOException ex2 = new java.io.IOException(e.getMessage()); + ex2.initCause(e); + throw ex2; } } @@ -181,7 +183,9 @@ class GraphicalComparator implements DocComparator System.err.println(" Outputpath: '" + m_aArguments.getOutputPath() + "'"); System.err.println("Referencepath: '" + m_aArguments.getReferencePath() + "'"); } - throw new java.io.IOException(e.getMessage()); + java.io.IOException ex2 = new java.io.IOException(e.getMessage()); + ex2.initCause(e); + throw ex2; } } @@ -223,7 +227,9 @@ class GraphicalComparator implements DocComparator catch(ConvWatchException e) { // wrap it to IOException - throw new java.io.IOException(e.getMessage()); + java.io.IOException ex2 = new java.io.IOException(e.getMessage()); + ex2.initCause(e); + throw ex2; } } |