Skip to content

Commit 2047ab4

Browse files
committed
Update JavaDoc comments for duke.exception package
1 parent 5e7d440 commit 2047ab4

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/main/java/duke/exception/DukeException.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ public class DukeException extends Exception {
1010

1111
/**
1212
* Handles exception to missing time input for deadline and event.
13+
*
14+
* @param command Command entered by user.
15+
* @throws DukeException if missing time input.
1316
*/
1417
public static void missingTimingException(String command) throws DukeException {
1518
if (command.startsWith("deadline") && !command.contains("/by")) {
@@ -30,6 +33,9 @@ public static void missingTimingException(String command) throws DukeException {
3033
/**
3134
* Handles exception to missing index input of task when marking/
3235
* unmarking/ deleting task.
36+
*
37+
* @param command Command entered by user.
38+
* @throws DukeException if missing index input.
3339
*/
3440
public static void missingIndexException(String command) throws DukeException {
3541
if (command.equals("mark")) {
@@ -49,7 +55,13 @@ public static void missingIndexException(String command) throws DukeException {
4955

5056
/**
5157
* Handles exception to invalid index input of task when marking/
52-
* unmarking/ deleting task. This occurs when
58+
* unmarking/ deleting task.
59+
* This occurs when index input is more or less than number of
60+
* existing tasks.
61+
*
62+
* @param command Command entered by user.
63+
* @param taskSize Total number of tasks.
64+
* @throws DukeException if wrong index input.
5365
*/
5466
public static void invalidIndexException(String command, int taskSize) throws DukeException {
5567
if (command.startsWith("mark") || command.startsWith("unmark") ||command.startsWith("delete")) {
@@ -74,6 +86,9 @@ public static void invalidIndexException(String command, int taskSize) throws Du
7486

7587
/**
7688
* Handles exception to missing command keyword.
89+
*
90+
* @param command Command entered by user.
91+
* @throws DukeException if invalid command input.
7792
*/
7893
public static void invalidCommandException(String command) throws DukeException {
7994
if (!command.startsWith("event") || !(command.startsWith("deadline")) ||
@@ -86,6 +101,9 @@ public static void invalidCommandException(String command) throws DukeException
86101

87102
/**
88103
* Handles exception to missing task description.
104+
*
105+
* @param command Command entered by user.
106+
* @throws DukeException if missing command information.
89107
*/
90108
public static void emptyCommandException(String command) throws DukeException {
91109
if (command.equals("todo")) {

0 commit comments

Comments
 (0)