mirror of
https://github.com/xerial/snappy-java.git
synced 2025-07-20 12:34:30 +02:00
Report exception message correctly
This commit is contained in:
parent
30b3d247bd
commit
c4870fb505
@ -194,7 +194,7 @@ public class SnappyLoader
|
|||||||
throw new SnappyError(SnappyErrorCode.FAILED_TO_LOAD_NATIVE_LIBRARY, ee.getMessage());
|
throw new SnappyError(SnappyErrorCode.FAILED_TO_LOAD_NATIVE_LIBRARY, ee.getMessage());
|
||||||
}
|
}
|
||||||
catch (Exception e2) {
|
catch (Exception e2) {
|
||||||
throw new SnappyError(SnappyErrorCode.FAILED_TO_LOAD_NATIVE_LIBRARY, e.getMessage());
|
throw new SnappyError(SnappyErrorCode.FAILED_TO_LOAD_NATIVE_LIBRARY, e2.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
|
@ -82,6 +82,13 @@ public class SnappyLoaderTest
|
|||||||
ClassLoader parent = this.getClass().getClassLoader().getParent();
|
ClassLoader parent = this.getClass().getClassLoader().getParent();
|
||||||
ClassWorld cw = new ClassWorld();
|
ClassWorld cw = new ClassWorld();
|
||||||
ClassRealm P = cw.newRealm("P", parent);
|
ClassRealm P = cw.newRealm("P", parent);
|
||||||
|
try {
|
||||||
|
P.loadClass("org.xerial.snappy.Snappy");
|
||||||
|
fail("org.xerial.snappy.Snappy is found in the parent");
|
||||||
|
}
|
||||||
|
catch (ClassNotFoundException e) {
|
||||||
|
// OK
|
||||||
|
}
|
||||||
|
|
||||||
// Prepare the child class loaders which can load Snappy.class
|
// Prepare the child class loaders which can load Snappy.class
|
||||||
URL classPath = new File("target/classes").toURI().toURL();
|
URL classPath = new File("target/classes").toURI().toURL();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user