From 80deab9b63a6d23d512459ef1de1ec60a942f7f2 Mon Sep 17 00:00:00 2001 From: Lingxi Xing Date: Tue, 10 Oct 2023 21:31:13 +0800 Subject: [PATCH] feat: Improve exception logging --- src/main/java/seedu/address/ui/HelpWindow.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/seedu/address/ui/HelpWindow.java b/src/main/java/seedu/address/ui/HelpWindow.java index b3ed3c7301c..015f5f5259f 100644 --- a/src/main/java/seedu/address/ui/HelpWindow.java +++ b/src/main/java/seedu/address/ui/HelpWindow.java @@ -13,6 +13,7 @@ import javafx.scene.input.ClipboardContent; import javafx.stage.Stage; import seedu.address.commons.core.LogsCenter; +import seedu.address.commons.util.StringUtil; /** * Controller for a help page @@ -117,10 +118,10 @@ private void openInBrowser() { } catch (IOException e) { // Handle the IOException, which may occur when the system cannot open the // default browser. - e.printStackTrace(); + logger.warning("Failed to open URL in default browser: " + StringUtil.getDetails(e)); } catch (URISyntaxException e) { // Handle the URISyntaxException, which may occur when the URL is not valid. - e.printStackTrace(); + logger.warning("Invalid URL specified: " + StringUtil.getDetails(e)); } } }