X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fnet%2Fsf%2Fopenrocket%2Fgui%2Fmain%2FExceptionHandler.java;fp=src%2Fnet%2Fsf%2Fopenrocket%2Fgui%2Fmain%2FExceptionHandler.java;h=702c3025cf5d866644f5a85dbf93d9e395f57bff;hb=def27b03bd9ebe6628421ec61112ebe4f45f043d;hp=8496ad5be57f6400d37d986a2f4764e54a999412;hpb=6db4fec8a7ff65b40f1d8b38a2fb254255e740af;p=debian%2Fopenrocket diff --git a/src/net/sf/openrocket/gui/main/ExceptionHandler.java b/src/net/sf/openrocket/gui/main/ExceptionHandler.java index 8496ad5b..702c3025 100644 --- a/src/net/sf/openrocket/gui/main/ExceptionHandler.java +++ b/src/net/sf/openrocket/gui/main/ExceptionHandler.java @@ -149,12 +149,18 @@ public class ExceptionHandler implements Thread.UncaughtExceptionHandler { return; } + // Create the message + String msg = e.getClass().getSimpleName() + ": " + e.getMessage(); + if (msg.length() > 90) { + msg = msg.substring(0, 80) + "..."; + } + // Unknown Error if (!(e instanceof Exception)) { JOptionPane.showMessageDialog(null, new Object[] { "An unknown Java error occurred:", - e.getMessage(), + msg, "You should immediately close unnecessary design windows,
" + "save any unsaved designs and restart OpenRocket!" }, "Unknown Java error", JOptionPane.ERROR_MESSAGE); @@ -162,13 +168,7 @@ public class ExceptionHandler implements Thread.UncaughtExceptionHandler { } - // Normal exception, show question dialog - String msg = e.getClass().getSimpleName() + ": " + e.getMessage(); - if (msg.length() > 90) { - msg = msg.substring(0, 80) + "..."; - } - - + // Normal exception, show question dialog int selection = JOptionPane.showOptionDialog(null, new Object[] { "OpenRocket encountered an uncaught exception. This typically signifies " + "a bug in the software.",