File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/main/java/org/truffleruby/debug Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 18
18
import java .util .List ;
19
19
import java .util .Map ;
20
20
21
+ import com .oracle .truffle .api .TruffleStackTrace ;
21
22
import com .oracle .truffle .api .TruffleStackTraceElement ;
22
23
import com .oracle .truffle .api .exception .AbstractTruffleException ;
23
24
import com .oracle .truffle .api .frame .Frame ;
@@ -489,9 +490,11 @@ public abstract static class ThrowJavaExceptionWithCauseNode extends CoreMethodA
489
490
@ Specialization (guards = "strings.isRubyString(message)" , limit = "1" )
490
491
protected Object throwJavaExceptionWithCause (Object message ,
491
492
@ Cached RubyStringLibrary strings ) {
492
- throw new RuntimeException (
493
- RubyGuards .getJavaString (message ),
494
- new RuntimeException ("cause 1" , new RuntimeException ("cause 2" )));
493
+ var cause2 = new RuntimeException ("cause 2" );
494
+ var cause1 = new RuntimeException ("cause 1" , cause2 );
495
+ TruffleStackTrace .fillIn (cause2 );
496
+ TruffleStackTrace .fillIn (cause1 );
497
+ throw new RuntimeException (RubyGuards .getJavaString (message ), cause1 );
495
498
}
496
499
497
500
}
You can’t perform that action at this time.
0 commit comments