* improve MediaInfoException text

This commit is contained in:
Reinhard Pointner 2015-11-10 06:19:50 +00:00
parent 9a663ea711
commit e6dbd4538e
1 changed files with 3 additions and 3 deletions

View File

@ -5,13 +5,13 @@ import com.sun.jna.Platform;
public class MediaInfoException extends RuntimeException {
public MediaInfoException(LinkageError e) {
super(getLinkageErrorMessage(e));
super(getLinkageErrorMessage(e), e);
}
private static String getLinkageErrorMessage(LinkageError e) {
String name = Platform.isWindows() ? "MediaInfo.dll" : Platform.isMac() ? "libmediainfo.dylib" : "libmediainfo.so";
String arch = System.getProperty("os.arch").toLowerCase().trim();
return String.format("Unable to load %s native library %s", arch, name);
String arch = System.getProperty("os.arch");
return String.format("Unable to load %s native library %s: %s", arch, name, e.getMessage());
}
}