[SPARK-10566] [CORE] SnappyCompressionCodec init exception handling masks important error information

When throwing an IllegalArgumentException in SnappyCompressionCodec.init, chain the existing exception. This allows potentially important debugging info to be passed to the user.

Manual testing shows the exception chained properly, and the test suite still looks fine as well.

This contribution is my original work and I license the work to the project under the project's open source license.

Author: Daniel Imfeld <daniel@danielimfeld.com>

Closes #8725 from dimfeld/dimfeld-patch-1.
This commit is contained in:
Daniel Imfeld 2015-09-12 09:19:59 +01:00 committed by Sean Owen
parent c34fc19765
commit 6d8367807c

View file

@ -148,7 +148,7 @@ class SnappyCompressionCodec(conf: SparkConf) extends CompressionCodec {
try {
Snappy.getNativeLibraryVersion
} catch {
case e: Error => throw new IllegalArgumentException
case e: Error => throw new IllegalArgumentException(e)
}
override def compressedOutputStream(s: OutputStream): OutputStream = {