mocobeta commented on a change in pull request #470:
URL: https://github.com/apache/lucene/pull/470#discussion_r758096467



##########
File path: lucene/luke/src/java/org/apache/lucene/luke/app/desktop/LukeMain.java
##########
@@ -55,29 +55,32 @@ public static JFrame getOwnerFrame() {
     return frame;
   }
 
-  private static void createAndShowGUI() {
+  /** @return Returns {@code true} if GUI startup and initialization was 
successful. */
+  private static boolean createAndShowGUI() {
     // uncaught error handler
     MessageBroker messageBroker = MessageBroker.getInstance();
-    Thread.setDefaultUncaughtExceptionHandler((thread, cause) -> handle(cause, 
messageBroker));
-
     try {
+      Thread.setDefaultUncaughtExceptionHandler((thread, cause) -> 
handle(cause, messageBroker));
+
       frame = new LukeWindowProvider().get();
       frame.setLocation(200, 100);
       frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       frame.pack();
       frame.setVisible(true);
 
-      // show open index dialog
       OpenIndexDialogFactory openIndexDialogFactory = 
OpenIndexDialogFactory.getInstance();
       new DialogOpener<>(openIndexDialogFactory)
           .open(
               MessageUtils.getLocalizedMessage("openindex.dialog.title"),
               600,
               420,
               (factory) -> {});
-    } catch (IOException e) {
+
+      return true;
+    } catch (Throwable e) {
       messageBroker.showUnknownErrorMessage();
       log.error("Cannot initialize components.", e);

Review comment:
       Sorry, this is my bad code though, could you include this in the PR?
   ```suggestion
         log.fatal("Cannot initialize components.", e);
   ```
   Also, this line should be removed (the broker transmits the error message to 
a GUI component, it does not make sense here).
   ```
   messageBroker.showUnknownErrorMessage();
   ```
   
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to