Skip to content

Commit

Permalink
feat: Improve exception logging
Browse files Browse the repository at this point in the history
  • Loading branch information
HugeNoob committed Oct 10, 2023
1 parent 8c7fa8e commit 80deab9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/seedu/address/ui/HelpWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -117,10 +118,10 @@ private void openInBrowser() {
} catch (IOException e) {

Check warning on line 118 in src/main/java/seedu/address/ui/HelpWindow.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/address/ui/HelpWindow.java#L117-L118

Added lines #L117 - L118 were not covered by tests
// 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) {

Check warning on line 122 in src/main/java/seedu/address/ui/HelpWindow.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/address/ui/HelpWindow.java#L121-L122

Added lines #L121 - L122 were not covered by tests
// Handle the URISyntaxException, which may occur when the URL is not valid.
e.printStackTrace();
logger.warning("Invalid URL specified: " + StringUtil.getDetails(e));
}
}

Check warning on line 126 in src/main/java/seedu/address/ui/HelpWindow.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/address/ui/HelpWindow.java#L124-L126

Added lines #L124 - L126 were not covered by tests
}

0 comments on commit 80deab9

Please sign in to comment.