21 lines
587 B
Java
21 lines
587 B
Java
package com.yfd.platform.exception;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
/**
|
|
* @Author pcj
|
|
* @Date 2021/1/26 9:07
|
|
* @Version 1.0
|
|
*/
|
|
public class ChildrenExistException extends RuntimeException{
|
|
|
|
public ChildrenExistException(Class clazz, String field, String val) {
|
|
super(ChildrenExistException.generateMessage(clazz.getSimpleName(), field, val));
|
|
}
|
|
|
|
private static String generateMessage(String entity, String field, String val) {
|
|
return StringUtils.capitalize(entity)
|
|
+ " with " + field + " "+ val + " Children Exist";
|
|
}
|
|
}
|