]> source.dussan.org Git - poi.git/commitdiff
Include root-cause exception information when constructing ContentTypeManager fails
authorDominik Stadler <centic@apache.org>
Wed, 26 Nov 2014 21:11:02 +0000 (21:11 +0000)
committerDominik Stadler <centic@apache.org>
Wed, 26 Nov 2014 21:11:02 +0000 (21:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1641940 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java

index d03a40ba02fcd93dce6201e55973aa053ee696a6..6b71d0dbe9cb52c6bbd65d92c7125fcf8bf257ba 100644 (file)
@@ -101,8 +101,12 @@ public abstract class ContentTypeManager {
                        try {
                                parseContentTypesFile(in);
                        } catch (InvalidFormatException e) {
-                               throw new InvalidFormatException(
-                                               "Can't read content types part !");
+                           InvalidFormatException ex = new InvalidFormatException("Can't read content types part !");
+
+                // here it is useful to add the cause to not loose the original stack-trace
+                ex.initCause(e);
+                       
+                throw ex;
                        }
                }
        }