forked from nus-cs2103-AY2425S2/ip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into branch-A-BetterGui
- Loading branch information
Showing
14 changed files
with
177 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/bhaymax/exception/TaskAlreadyExistsException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package bhaymax.exception; | ||
|
||
/** | ||
* Thrown when an attempt to add a duplicate task to the tasks list occurs | ||
*/ | ||
public class TaskAlreadyExistsException extends RuntimeException { | ||
public static final String ERROR_MESSAGE = "You have already added this task to your list."; | ||
|
||
public TaskAlreadyExistsException() { | ||
super(TaskAlreadyExistsException.ERROR_MESSAGE); | ||
} | ||
|
||
public TaskAlreadyExistsException(String message) { | ||
super(message); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/bhaymax/exception/command/AttemptToCreateDuplicateTaskException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package bhaymax.exception.command; | ||
|
||
import bhaymax.exception.TaskAlreadyExistsException; | ||
|
||
/** | ||
* Thrown when a user attempts to add a task that already exists | ||
*/ | ||
public class AttemptToCreateDuplicateTaskException extends InvalidCommandFormatException { | ||
public AttemptToCreateDuplicateTaskException() { | ||
super(TaskAlreadyExistsException.ERROR_MESSAGE); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/bhaymax/exception/command/InvalidTimeRangeForEventException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package bhaymax.exception.command; | ||
|
||
/** | ||
* Thrown when the end date for an event precedes its start date | ||
* (which is obviously invalid as you can't have an event end | ||
* before it even starts) | ||
*/ | ||
public class InvalidTimeRangeForEventException extends InvalidCommandFormatException { | ||
public static final String ERROR_MESSAGE = "The date range provided for event is incorrect. " | ||
+ "End date should be after or equal to the start date"; | ||
|
||
public InvalidTimeRangeForEventException() { | ||
super(InvalidTimeRangeForEventException.ERROR_MESSAGE); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/bhaymax/exception/file/DuplicateTaskInFileException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package bhaymax.exception.file; | ||
|
||
/** | ||
* Thrown when there are duplicates in the tasks file | ||
*/ | ||
public class DuplicateTaskInFileException extends InvalidFileFormatException { | ||
public static final String ERROR_MESSAGE = "This line has been duplicated at least once."; | ||
|
||
public DuplicateTaskInFileException(int lineNumber) { | ||
super(lineNumber, DuplicateTaskInFileException.ERROR_MESSAGE); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.