File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/exception Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -95,8 +95,8 @@ public PException(PBaseException actual, Node node) {
95
95
this .pythonException = actual ;
96
96
}
97
97
98
- public PException (PBaseException actual , Node node , Throwable cause ) {
99
- super (null , cause , UNLIMITED_STACK_TRACE , node );
98
+ public PException (PBaseException actual , Node node , Throwable wrapped ) {
99
+ super (null , wrapped , UNLIMITED_STACK_TRACE , node );
100
100
this .pythonException = actual ;
101
101
}
102
102
@@ -231,7 +231,12 @@ public Iterable<TruffleStackTraceElement> getTruffleStackTrace() {
231
231
if (tracebackCutoffTarget == null ) {
232
232
tracebackCutoffTarget = Truffle .getRuntime ().getCurrentFrame ().getCallTarget ();
233
233
}
234
- return TruffleStackTrace .getStackTrace (this );
234
+ // Cause may contain wrapped Java exception
235
+ if (getCause () != null ) {
236
+ return TruffleStackTrace .getStackTrace (getCause ());
237
+ } else {
238
+ return TruffleStackTrace .getStackTrace (this );
239
+ }
235
240
}
236
241
237
242
public boolean shouldCutOffTraceback (TruffleStackTraceElement element ) {
You can’t perform that action at this time.
0 commit comments