Skip to content

Commit a9c05cc

Browse files
committed
Merge branch 'master' into primitive_array
2 parents 9b50e05 + d287785 commit a9c05cc

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

java/src/main/java/org/astonbitecode/j4rs/utils/Utils.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616

1717
import java.io.PrintWriter;
1818
import java.io.StringWriter;
19+
import java.lang.reflect.InvocationTargetException;
1920
import java.util.Arrays;
2021

2122
import org.astonbitecode.j4rs.api.dtos.GeneratedArg;
23+
import org.astonbitecode.j4rs.errors.InvocationException;
2224

2325
public class Utils {
2426

@@ -74,7 +76,12 @@ public static String throwableToString(Throwable throwable) {
7476
if (throwable != null) {
7577
StringWriter sw = new StringWriter();
7678
PrintWriter pw = new PrintWriter(sw);
77-
throwable.printStackTrace(pw);
79+
if (throwable != null && throwable instanceof InvocationException
80+
&& throwable.getCause() != null && throwable.getCause() instanceof InvocationTargetException) {
81+
throwable.getCause().getCause().printStackTrace(pw);
82+
} else {
83+
throwable.printStackTrace(pw);
84+
}
7885
return sw.toString();
7986
} else {
8087
return "Cannot create String out of a null Throwable";
110 Bytes
Binary file not shown.

rust/src/utils.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ fn find_j4rs_dynamic_libraries_dir_entries() -> errors::Result<Vec<fs::DirEntry>
134134
let file_name = entry.file_name();
135135
let file_name = file_name.to_str().unwrap();
136136
file_name.contains("j4rs")
137+
&& !file_name.contains("derive")
137138
&& (file_name.contains(".so")
138139
|| file_name.contains(".dll")
139140
|| file_name.contains(".dylib"))

0 commit comments

Comments
 (0)