package com.kcim.common.exception;

import com.kcim.common.enums.ErrorCodeEnum;

public class CostException extends RuntimeException{

    private int code;

    private String message;

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

    public CostException(String message) {
        super(message);
        this.code = 500;
        this.message = message;
    }

    public CostException(ErrorCodeEnum errorCodeEnum) {
        super(errorCodeEnum.getDescription());
        this.code = errorCodeEnum.getCode();
        this.message = errorCodeEnum.getDescription();
    }


    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
