parent
d36ce15e14
commit
0bdee6f374
@ -0,0 +1,35 @@
|
||||
package com.studentmanagement.exception;
|
||||
|
||||
/**
|
||||
* 学生未找到异常
|
||||
* 当尝试访问不存在的学生记录时抛出
|
||||
*/
|
||||
public class StudentNotFoundException extends Exception {
|
||||
private String studentId;
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
* @param message 异常消息
|
||||
* @param studentId 学生ID
|
||||
*/
|
||||
public StudentNotFoundException(String message, String studentId) {
|
||||
super(message);
|
||||
this.studentId = studentId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
* @param message 异常消息
|
||||
*/
|
||||
public StudentNotFoundException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学生ID
|
||||
* @return 学生ID
|
||||
*/
|
||||
public String getStudentId() {
|
||||
return studentId;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue