Skip to content

Commit

Permalink
More improvements to exception messages
Browse files Browse the repository at this point in the history
  • Loading branch information
serivesmejia committed Oct 2, 2021
1 parent 10e74cb commit 6fa7458
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/io/github/deltacv/apriltag/NativeLibLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static void load() {
extension = "dylib";
break;
case UNKNOWN:
throw new UnsupportedOperationException(osName + " platform is not supported for the april tag desktop plugin!");
throw new UnsupportedOperationException("The " + osName + " platform couldn't be recognized, therefore the april tag desktop plugin is not supported");
}

String name = "libapriltag." + extension;
Expand All @@ -80,15 +80,15 @@ public static void load() {
try {
Files.copy(NativeLibLoader.class.getResourceAsStream("/" + name), tempFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
} catch(NullPointerException e) {
throw new UnsupportedOperationException("The AprilTag plugin is not supported in the " + osName + " platform", e);
throw new UnsupportedOperationException("A native lib could not be found for the " + osName + " platform, this probably means that the AprilTag plugin is not supported", e);
} catch(Exception e) {
throw new RuntimeException("Error while extracting native library", e);
}

try {
System.load(tempFile.getAbsolutePath());
} catch(Throwable e) {
throw new UnsupportedOperationException("The AprilTag plugin is not supported in the " + osName + " platform", e);
throw new UnsupportedOperationException("The native library failed to link, which probably means that the AprilTag plugin is not supported in the " + osName + " platform", e);
}
}

Expand Down

0 comments on commit 6fa7458

Please sign in to comment.