You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virtual-patient/virtual-patient-common/src/main/java/com/supervision/exception/HumanException.java

60 lines
1.2 KiB
Java

/*
* : CustomException
* :
* : <>
* : RedName
* : 2022/8/5
* : <>
* : <>
* : <>
*/
package com.supervision.exception;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
/**
* <>
*
*
* @author ljt
* @version [, 2022/8/5]
* @see [/]
* @since [/]
*/
@Slf4j
public class HumanException extends RuntimeException {
/**
* ,,
*/
private static final Integer HUMAN_ERROR = 6001;
/**
*
*/
private final Integer code;
/**
*
*/
private final String message;
private HumanException(Integer code, String message) {
this.code = code;
this.message = message;
}
public static HumanException humanError(String message) {
return new HumanException(HUMAN_ERROR, message);
}
@Override
public String getMessage() {
return message;
}
public Integer getCode() {
return code;
}
}