Include root-cause exception information when constructing ContentTypeManager fails

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1641940 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2014-11-26 21:11:02 +00:00
parent eae3eb5c58
commit f4c52d16d8
1 changed files with 6 additions and 2 deletions

View 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;
}
}
}