MCPcopy Index your code
hub / github.com/benfry/processing4 / exceptionEvent

Method exceptionEvent

java/src/processing/mode/java/runner/Runner.java:701–732  ·  view source on GitHub ↗
(ExceptionEvent event)

Source from the content-addressed store, hash-verified

699
700
701 public void exceptionEvent(ExceptionEvent event) {
702 ObjectReference or = event.exception();
703 ReferenceType rt = or.referenceType();
704 String exceptionName = rt.name();
705 //Field messageField = Throwable.class.getField("detailMessage");
706 Field messageField = rt.fieldByName("detailMessage");
707// System.out.println("field " + messageField);
708 Value messageValue = or.getValue(messageField);
709// System.out.println("mess val " + messageValue);
710
711 //"java.lang.ArrayIndexOutOfBoundsException"
712 int last = exceptionName.lastIndexOf('.');
713 String message = exceptionName.substring(last + 1);
714 if (messageValue != null) {
715 String messageStr = messageValue.toString();
716 if (messageStr.startsWith("\"")) {
717 messageStr = messageStr.substring(1, messageStr.length() - 1);
718 }
719 message += ": " + messageStr;
720 }
721// System.out.println("mess type " + messageValue.type());
722 //StringReference messageReference = (StringReference) messageValue.type();
723
724 // First just report the exception and its placement
725 reportException(message, or, event.thread());
726 // Then try to pretty it up with a better message
727 handleCommonErrors(exceptionName, message, listener, sketchErr);
728
729 if (editor != null) {
730 java.awt.EventQueue.invokeLater(() -> editor.onRunnerExiting(Runner.this));
731 }
732 }
733
734
735 /**

Callers 1

generateTraceMethod · 0.95

Calls 6

reportExceptionMethod · 0.95
handleCommonErrorsMethod · 0.95
getValueMethod · 0.80
threadMethod · 0.80
onRunnerExitingMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected