MCPcopy Create free account
hub / github.com/boazy/TWEditorEnhanced / logException

Method logException

src/main/java/Main.java:284–327  ·  view source on GitHub ↗
(String text, Throwable exc)

Source from the content-addressed store, hash-verified

282 }
283
284 public static void logException(String text, Throwable exc)
285 {
286 System.runFinalization();
287 System.gc();
288
289 if (SwingUtilities.isEventDispatchThread()) {
290 StringBuilder string = new StringBuilder(512);
291
292 string.append("<html><b>");
293 string.append(text);
294 string.append("</b><br><br>");
295
296 string.append("<b>");
297 string.append(exc.toString());
298 string.append("</b><br><br>");
299
300 StackTraceElement[] trace = exc.getStackTrace();
301 int count = 0;
302 for (StackTraceElement elem : trace) {
303 string.append(elem.toString());
304 string.append("<br>");
305 count++; if (count == 25) {
306 break;
307 }
308 }
309 string.append("</html>");
310 JOptionPane.showMessageDialog(mainWindow, string, "Error", 0);
311 } else if (deferredException == null) {
312 deferredText = text;
313 deferredException = exc;
314 try {
315 SwingUtilities.invokeAndWait(new Runnable() {
316 public void run() {
317 Main.logException(Main.deferredText, Main.deferredException);
318 //Main.access$102(null);
319 //Main.access$002(null);
320 } } );
321 }
322 catch (Throwable swingException) {
323 deferredException = null;
324 deferredText = null;
325 }
326 }
327 }
328
329 public static void dumpData(String text, byte[] data, int offset, int length)
330 {

Callers 15

finalizeMethod · 0.95
actionPerformedMethod · 0.95
actionPerformedMethod · 0.95
loadSaveMethod · 0.95
saveFileMethod · 0.95
windowClosingMethod · 0.95
finalizeMethod · 0.95
finalizeMethod · 0.95
actionPerformedMethod · 0.95
runMethod · 0.95
finalizeMethod · 0.95
actionPerformedMethod · 0.95

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected