You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
MVC/StudentNotFoundException.java

23 lines
520 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.studentmanagement.exception;
/**
* 学生未找到异常,当尝试操作不存在的学生时抛出
*/
public class StudentNotFoundException extends Exception {
/**
* 构造函数
* @param message 异常信息
*/
public StudentNotFoundException(String message) {
super(message);
}
/**
* 构造函数带学生ID
* @param id 学生ID
*/
public StudentNotFoundException(int id) {
super("学生ID " + id + " 未找到");
}
}