public CorruptObjectException(final String why) {
super(why);
}
+
+ /**
+ * Construct a CorruptObjectException for reporting a problem not associated
+ * with a specific object id.
+ *
+ * @param why
+ * message describing the corruption.
+ * @param cause
+ * optional root cause exception
+ * @since 3.4
+ */
+ public CorruptObjectException(String why, Throwable cause) {
+ super(why);
+ initCause(cause);
+ }
}
try {
objCheck.check(type, data);
} catch (CorruptObjectException e) {
- throw new IOException(MessageFormat.format(
- JGitText.get().invalidObject, Constants
- .typeString(type), id.name(), e.getMessage()));
+ throw new CorruptObjectException(MessageFormat.format(
+ JGitText.get().invalidObject,
+ Constants.typeString(type),
+ id.name(), e.getMessage()), e);
}
}