package com.skr.mdm.exception;

import com.skr.mdm.enums.ResultCodeEnum;
import lombok.Getter;

/**
 * 业务异常
 * @author nfq
 * @date 2022-11-29 16:35
 */
@Getter
public class ServiceException extends RuntimeException{

    private String code;

    private String message;

    public ServiceException() {
        super();
    }

    public ServiceException(String message) {
        super(message);
        this.message = message;
    }

    public ServiceException(String code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public ServiceException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMsg());
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMsg();
    }

}
