Skip to content

Commit

Permalink
Merge branch 'master' into primitive_array
Browse files Browse the repository at this point in the history
  • Loading branch information
pickleburger committed Apr 30, 2024
2 parents 9b50e05 + d287785 commit a9c05cc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion java/src/main/java/org/astonbitecode/j4rs/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;

import org.astonbitecode.j4rs.api.dtos.GeneratedArg;
import org.astonbitecode.j4rs.errors.InvocationException;

public class Utils {

Expand Down Expand Up @@ -74,7 +76,12 @@ public static String throwableToString(Throwable throwable) {
if (throwable != null) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
throwable.printStackTrace(pw);
if (throwable != null && throwable instanceof InvocationException
&& throwable.getCause() != null && throwable.getCause() instanceof InvocationTargetException) {
throwable.getCause().getCause().printStackTrace(pw);
} else {
throwable.printStackTrace(pw);
}
return sw.toString();
} else {
return "Cannot create String out of a null Throwable";
Expand Down
Binary file modified rust/jassets/j4rs-0.19.0-SNAPSHOT-jar-with-dependencies.jar
Binary file not shown.
1 change: 1 addition & 0 deletions rust/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ fn find_j4rs_dynamic_libraries_dir_entries() -> errors::Result<Vec<fs::DirEntry>
let file_name = entry.file_name();
let file_name = file_name.to_str().unwrap();
file_name.contains("j4rs")
&& !file_name.contains("derive")
&& (file_name.contains(".so")
|| file_name.contains(".dll")
|| file_name.contains(".dylib"))
Expand Down

0 comments on commit a9c05cc

Please sign in to comment.