package com.wisedu.coeus.core.exception;

//import com.wisedu.coeus.util.MessageUtils;
//import com.wisedu.coeus.util.StringUtils;

import org.springframework.util.StringUtils;

/**
 * 异常基类
 */
public class CoeusBaseException extends RuntimeException {
    public String getErrorMessage() {
        return errorMessage;
    }

    public String getLocalizedErrorMessage() {
        return errorMessage;
    }

    public String getErrorCode() {
        return errorCode;
    }

    private String errorCode;
    private String errorMessage;
    private String messageId;

    public CoeusBaseException(String code,  String message) {
        super(code.concat(" ").concat(message==null?"":message));
        this.errorCode = code;
        this.errorMessage  = message;
        this.messageId = null;
    }

    public CoeusBaseException(String code, String message, String messageId) {
//        super(code.concat(" ").concat((StringUtils.isEmpty(messageId) ? message : MessageUtils.getMessage(messageId))));
//        this.errorCode = code;
//        this.errorMessage  = (StringUtils.isEmpty(messageId) ? message : MessageUtils.getMessage(messageId));
//        this.messageId = messageId;
    }

    public CoeusBaseException(Throwable throwable) {

    }
}
