Skip to content

Commit ca77a0f

Browse files
committed
Merge branch 'master' of github.com:processing/processing
2 parents 292e785 + bd853ad commit ca77a0f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

java/src/processing/mode/java/runner/Runner.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,12 @@ protected SketchException findException(String message, ObjectReference or, Thre
747747
// This shouldn't happen, but if it does, print the exception in case
748748
// it's something that needs to be debugged separately.
749749
e.printStackTrace(sketchErr);
750+
} catch (Exception e) {
751+
// stack overflows seem to trip in frame.location() above
752+
// ignore this case so that the actual error gets reported to the user
753+
if ("StackOverflowError".equals(message) == false) {
754+
e.printStackTrace(sketchErr);
755+
}
750756
}
751757
// before giving up, try to extract from the throwable object itself
752758
// since sometimes exceptions are re-thrown from a different context
@@ -778,7 +784,11 @@ protected SketchException findException(String message, ObjectReference or, Thre
778784
or.invokeMethod(thread, method, new ArrayList<Value>(), ObjectReference.INVOKE_SINGLE_THREADED);
779785

780786
} catch (Exception e) {
781-
e.printStackTrace(sketchErr);
787+
// stack overflows will make the exception handling above trip again
788+
// ignore this case so that the actual error gets reported to the user
789+
if ("StackOverflowError".equals(message) == false) {
790+
e.printStackTrace(sketchErr);
791+
}
782792
}
783793
// Give up, nothing found inside the pile of stack frames
784794
SketchException rex = new SketchException(message);

0 commit comments

Comments
 (0)