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

Method showTrace

app/src/processing/app/Messages.java:123–150  ·  view source on GitHub ↗

Warning window that includes the stack trace.

(String title, String message,
                               Throwable t, boolean fatal)

Source from the content-addressed store, hash-verified

121 * Warning window that includes the stack trace.
122 */
123 static public void showTrace(String title, String message,
124 Throwable t, boolean fatal) {
125 if (title == null) title = fatal ? "Error" : "Warning";
126
127 if (Base.isCommandLine()) {
128 System.err.println(title + ": " + message);
129 if (t != null) {
130 t.printStackTrace();
131 }
132
133 } else {
134 StringWriter sw = new StringWriter();
135 t.printStackTrace(new PrintWriter(sw));
136
137 JOptionPane.showMessageDialog(new Frame(),
138 // first <br/> clears to the next line
139 // second <br/> is a shorter height blank space before the trace
140 Toolkit.formatMessage(message + "<br/><tt><br/>" + sw + "</tt>"),
141 title,
142 fatal ?
143 JOptionPane.ERROR_MESSAGE :
144 JOptionPane.WARNING_MESSAGE);
145
146 if (fatal) {
147 System.exit(1);
148 }
149 }
150 }
151
152
153 static public int showYesNoQuestion(Frame editor, String title,

Callers 7

mainMethod · 0.95
createAndShowGUIMethod · 0.95
handleWelcomeScreenMethod · 0.95
handleNewMethod · 0.95
handleOpenInternalMethod · 0.95
getSettingsFolderMethod · 0.95
getLibCMethod · 0.95

Calls 5

isCommandLineMethod · 0.95
formatMessageMethod · 0.95
printlnMethod · 0.45
printStackTraceMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected