diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-15 16:17:25 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-09-25 13:47:25 +0200 |
commit | 83636d2c09802aeeb1b30078022d228d04da21eb (patch) | |
tree | 8a0c619e16c1f6b5388939d5da2956f7ef758c19 /xmerge | |
parent | cf49392511e98851174b353782df9eb6bac46f77 (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 'xmerge')
-rw-r--r-- | xmerge/source/xmerge/java/org/openoffice/xmerge/converter/dom/DOMDocument.java | 11 | ||||
-rw-r--r-- | xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeDocument.java | 7 |
2 files changed, 6 insertions, 12 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 a2e67c08f4cf..cbade8a53ffc 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 @@ -27,7 +27,6 @@ import java.io.IOException; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.ParserConfigurationException; - import javax.xml.transform.TransformerFactory; import javax.xml.transform.Transformer; import javax.xml.transform.stream.StreamResult; @@ -36,7 +35,6 @@ import javax.xml.transform.dom.DOMSource; import org.w3c.dom.Node; import org.w3c.dom.Document; import org.xml.sax.SAXException; - import org.openoffice.xmerge.util.Debug; /** @@ -296,16 +294,15 @@ public class DOMDocument throw new IOException("No appropriate API (JAXP/Xerces) to serialize XML document: " + domImpl); } } - } catch (ClassNotFoundException cnfe) { - throw new IOException(cnfe.toString()); - } catch (Exception e) { + } + 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.toString()); + throw new IOException(e); } byte bytes[] = baos.toByteArray(); return bytes; } -}
\ No newline at end of file +} 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 df3fec9660b1..d468b426ac45 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,17 +813,14 @@ 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); + throw new IOException("No appropriate API (JAXP/Xerces) to serialize XML document: " + domImpl, e); } } } - catch (ClassNotFoundException cnfe) { - throw new IOException(cnfe.toString()); - } 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.toString()); + throw new IOException(e); } byte bytes[] = baos.toByteArray(); |