This makes it easier to identify higher in the call stack. Change-Id: I829431c38c71fa1899e33916252b75f09db8ecbdtags/v3.4.0.201405051725-m7
@@ -90,4 +90,19 @@ public class CorruptObjectException extends IOException { | |||
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); | |||
} | |||
} |
@@ -1014,9 +1014,10 @@ public abstract class PackParser { | |||
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); | |||
} | |||
} | |||