From 53f38c72664653f433d01cb645c9f6daa9269a58 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Tue, 12 May 2015 22:31:10 +0200 Subject: better error messages in native library extraction --- .../scala/com/github/jodersky/flow/internal/NativeLoader.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flow-main/src/main/scala/com/github/jodersky/flow/internal/NativeLoader.scala b/flow-main/src/main/scala/com/github/jodersky/flow/internal/NativeLoader.scala index 2526293..dc539ea 100644 --- a/flow-main/src/main/scala/com/github/jodersky/flow/internal/NativeLoader.scala +++ b/flow-main/src/main/scala/com/github/jodersky/flow/internal/NativeLoader.scala @@ -42,10 +42,12 @@ object NativeLoader { private def loadFromJar(library: String) = { val fqlib = System.mapLibraryName(library) //fully qualified library name - extract(s"/native/${os}-${arch}/${fqlib}", fqlib) match { + val path = s"/native/${os}-${arch}/${fqlib}" + extract(path, fqlib) match { case Some(file) => System.load(file.getAbsolutePath) case None => throw new UnsatisfiedLinkError("Cannot extract flow's native library, " + - "the native library may not exist for your specific architecture/OS combination.") + "the native library does not exist for your specific architecture/OS combination." + + "Could not find " + path + ".") } } @@ -55,4 +57,4 @@ object NativeLoader { case ex: UnsatisfiedLinkError => loadFromJar(library) } -} \ No newline at end of file +} -- cgit v1.2.3