| 12345678910111213141516171819202122232425262728293031 |
- package nju.seec.helper.util.exception;
- import lombok.AllArgsConstructor;
- import lombok.Getter;
- /**
- * @author cst
- */
- @Getter
- @AllArgsConstructor(staticName = "of")
- public class HelperException extends RuntimeException {
- private final ExceptionType type;
- private final String msg;
- @Getter
- public enum ExceptionType {
- // http code
- NOT_LOGIN(401), FORBIDDEN(403), NOT_FOUND(404), CONFLICT(409), SYSTEM_ERROR(500);
- private int code;
- ExceptionType(int code) {
- this.code = code;
- }
- }
- @Override
- public String getMessage() {
- return msg;
- }
- }
|