package com.usoftchina.dingtalk.sdk.exception;

import com.taobao.api.ApiException;
import com.taobao.api.TaobaoResponse;

/**
 * @author yingp
 */
public class DingTalkInvokeException extends RuntimeException {
    private final String code;

    public DingTalkInvokeException(TaobaoResponse resp) {
        super(resp.getMsg());
        this.code = resp.getErrorCode();
    }

    public DingTalkInvokeException(ApiException e) {
        super(e.getErrMsg());
        this.code = e.getErrCode();
    }

    public String getCode() {
        return code;
    }
}
