-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExceptionManager.java
More file actions
51 lines (45 loc) · 1.96 KB
/
Copy pathExceptionManager.java
File metadata and controls
51 lines (45 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Manages custom exceptions used throughout the student management system
public class ExceptionManager {
// Thrown when a person type in the input file is not recognized
public static class InvalidPersonTypeException extends Exception {
public InvalidPersonTypeException(String type) {
super("Invalid Person Type");
}
}
// Thrown when a student with the given ID cannot be found
public static class NonExistentStudentException extends Exception {
public NonExistentStudentException(String id) {
super("Student Not Found with ID " + id);
}
}
// Thrown when an academic member with the given ID cannot be found
public static class NonExistentAcaMemberException extends Exception {
public NonExistentAcaMemberException(String id) {
super("Academic Member Not Found with ID " + id);
}
}
// Thrown when a department with the given name does not exist
public static class NonExistentDeptException extends Exception {
public NonExistentDeptException(String deptName) {
super("Department " + deptName + " Not Found");
}
}
// Thrown when a program code does not exist in the system
public static class NonExistentProgException extends Exception {
public NonExistentProgException(String code) {
super("Program " + code + " Not Found");
}
}
// Thrown when a course code does not exist in the system
public static class NonExistentCourseException extends Exception {
public NonExistentCourseException(String code) {
super("Course " + code + " Not Found");
}
}
// Thrown when a grade is not recognized as a valid letter grade
public static class InvalidGradeException extends Exception {
public InvalidGradeException(String grade) {
super("Invalid Letter Grade: " + grade);
}
}
}