package cokr.xit.ens.core.exception;

import cokr.xit.ens.core.exception.code.EnsErrCd;

public class EnsException extends RuntimeException {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;

    private EnsErrCd errCd;

    private Object data;

    public EnsException(EnsErrCd errCd) {
        super(errCd.getCodeNm());
        this.errCd = errCd;
    }

    public EnsException(EnsErrCd errCd, String message) {
//		super(String.format("%s::: %s", errCd.getCodeNm(), message));
        super(String.format("%s", message));
        this.errCd = errCd;
    }

    public EnsException(EnsErrCd errCd, String message, Object data) {
        super(String.format("%s", message));
        this.errCd = errCd;
        this.data = data;
    }

    public EnsException(EnsErrCd errCd, String message, Throwable cause) {
//		super(String.format("%s::: %s", errCd.getCodeNm(), message), cause);
        super(String.format("%s", message), cause);
        this.errCd = errCd;
    }

    public EnsErrCd getErrCd() {
        return errCd;
    }

    public Object getData() { return data; }


}

