package com.e6yun.project.sdk.api.exception;

import com.google.common.base.MoreObjects;

/**
 * @author xuexiang@e6yun.com
 */
public class ApiException extends Exception{

    /**
     * 接口状态码
     */
    private int code;


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

    public ApiException(int code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(ApiException.class)
                .add("super", super.toString())
                .add("code", code)
                .toString();
    }
}
