mirror of
https://github.com/processing/processing4.git
synced 2026-01-29 11:21:06 +01:00
Merge pull request #4152 from gohai/recursion-message
Make the error message for stack overflows clearer
This commit is contained in:
@@ -749,6 +749,12 @@ public class Runner implements MessageConsumer {
|
||||
// This shouldn't happen, but if it does, print the exception in case
|
||||
// it's something that needs to be debugged separately.
|
||||
e.printStackTrace(sketchErr);
|
||||
} catch (Exception e) {
|
||||
// stack overflows seem to trip in frame.location() above
|
||||
// ignore this case so that the actual error gets reported to the user
|
||||
if ("StackOverflowError".equals(message) == false) {
|
||||
e.printStackTrace(sketchErr);
|
||||
}
|
||||
}
|
||||
// before giving up, try to extract from the throwable object itself
|
||||
// since sometimes exceptions are re-thrown from a different context
|
||||
@@ -780,7 +786,11 @@ public class Runner implements MessageConsumer {
|
||||
or.invokeMethod(thread, method, new ArrayList<Value>(), ObjectReference.INVOKE_SINGLE_THREADED);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(sketchErr);
|
||||
// stack overflows will make the exception handling above trip again
|
||||
// ignore this case so that the actual error gets reported to the user
|
||||
if ("StackOverflowError".equals(message) == false) {
|
||||
e.printStackTrace(sketchErr);
|
||||
}
|
||||
}
|
||||
// Give up, nothing found inside the pile of stack frames
|
||||
SketchException rex = new SketchException(message);
|
||||
|
||||
Reference in New Issue
Block a user