Skip to content

Commit 79bc9f0

Browse files
author
Robin Duda
committed
friendlier exception message when missing display.
1 parent baebbc6 commit 79bc9f0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/main/java/com/codingchili/ApplicationLauncher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private void waitForElasticServerAvailability() {
6767
try {
6868
Desktop.getDesktop().browse(new URI(Configuration.getWebsiteURL()));
6969
} catch (Exception e) {
70-
logger.onError(e);
70+
logger.displayNotAvailable(e);
7171
}
7272
consumer.pause();
7373
});

src/main/java/com/codingchili/logging/ApplicationLogger.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,4 +215,12 @@ public static String traceToText(Throwable throwable) {
215215
public void websiteStarted(int webPort) {
216216
logger.info("Started website on port " + webPort);
217217
}
218+
219+
/**
220+
* On failure to access the desktop/display.
221+
* @param e exception thrown when attempting to open the browser.
222+
*/
223+
public void displayNotAvailable(Exception e) {
224+
logger.warning("Failed to open website: " + e.getMessage());
225+
}
218226
}

0 commit comments

Comments
 (0)