File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
java/src/main/java/org/astonbitecode/j4rs/utils Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 16
16
17
17
import java .io .PrintWriter ;
18
18
import java .io .StringWriter ;
19
+ import java .lang .reflect .InvocationTargetException ;
19
20
import java .util .Arrays ;
20
21
21
22
import org .astonbitecode .j4rs .api .dtos .GeneratedArg ;
23
+ import org .astonbitecode .j4rs .errors .InvocationException ;
22
24
23
25
public class Utils {
24
26
@@ -74,7 +76,12 @@ public static String throwableToString(Throwable throwable) {
74
76
if (throwable != null ) {
75
77
StringWriter sw = new StringWriter ();
76
78
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
+ }
78
85
return sw .toString ();
79
86
} else {
80
87
return "Cannot create String out of a null Throwable" ;
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ fn find_j4rs_dynamic_libraries_dir_entries() -> errors::Result<Vec<fs::DirEntry>
134
134
let file_name = entry. file_name ( ) ;
135
135
let file_name = file_name. to_str ( ) . unwrap ( ) ;
136
136
file_name. contains ( "j4rs" )
137
+ && !file_name. contains ( "derive" )
137
138
&& ( file_name. contains ( ".so" )
138
139
|| file_name. contains ( ".dll" )
139
140
|| file_name. contains ( ".dylib" ) )
You can’t perform that action at this time.
0 commit comments