package com.ots.project.common.exception; import com.ots.common.enums.CodeEnum; import lombok.Getter; @Getter public class BaseException extends RuntimeException { private static final long serialVersionUID = 2746456762819176173L; protected CodeEnum responseEnum; protected Object[] args; public BaseException(CodeEnum responseEnum) { super(responseEnum.getMessage()); this.responseEnum = responseEnum; } public BaseException(int code, String msg) { super(msg); this.responseEnum = new CodeEnum() { @Override public int getCode() { return code; } @Override public String getMessage() { return msg; } }; } public BaseException(CodeEnum responseEnum, Object[] args, String message) { super(message); this.responseEnum = responseEnum; this.args = args; } public BaseException(CodeEnum responseEnum, Object[] args, String message, Throwable cause) { super(message, cause); this.responseEnum = responseEnum; this.args = args; } }