diff options
-rw-r--r-- | xmerge/source/xmerge/java/org/openoffice/xmerge/converter/dom/DOMDocument.java | 4 | ||||
-rw-r--r-- | xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeDocument.java | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/dom/DOMDocument.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/dom/DOMDocument.java index cbade8a53ffc..f722732be8c3 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/dom/DOMDocument.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/dom/DOMDocument.java @@ -298,7 +298,9 @@ public class DOMDocument catch (Exception e) { // We may get some other errors, but the bottom line is that // the steps being executed no longer work - throw new IOException(e); + IOException newEx = new IOException(e.getMessage()); + newEx.initCause(e); + throw newEx; } byte bytes[] = baos.toByteArray(); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeDocument.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeDocument.java index d468b426ac45..706b58d18cc1 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeDocument.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeDocument.java @@ -813,14 +813,18 @@ public abstract class OfficeDocument return writer.toString().getBytes(); } catch (Exception e) { // We don't have another parser - throw new IOException("No appropriate API (JAXP/Xerces) to serialize XML document: " + domImpl, e); + IOException newEx = new IOException("No appropriate API (JAXP/Xerces) to serialize XML document: " + domImpl); + newEx.initCause(e); + throw newEx; } } } catch (Exception e) { // We may get some other errors, but the bottom line is that // the steps being executed no longer work - throw new IOException(e); + IOException newEx = new IOException(e.getMessage()); + newEx.initCause(e); + throw newEx; } byte bytes[] = baos.toByteArray(); |