Skip to content

Commit

Permalink
Improve exception handling when application fails to start
Browse files Browse the repository at this point in the history
Prevent the usage of the logger when the application has not started
regardless of the cause since it's most likely not configured yet.

Closes quarkusio#42084
  • Loading branch information
zakkak committed Aug 1, 2024
1 parent a398b4d commit 9091010
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ public static void run(Application application, Class<? extends QuarkusApplicati
} else if (rootCause instanceof PreventFurtherStepsException
&& !StringUtil.isNullOrEmpty(rootCause.getMessage())) {
System.err.println(rootCause.getMessage());
} else if (!currentApplication.isStarted()) {
System.err.println("Failed to start application");
e.printStackTrace();
} else {
applicationLogger.errorv(e, "Failed to start application");
ensureConsoleLogsDrained();
Expand Down

0 comments on commit 9091010

Please sign in to comment.