package cn.datax.service.data.factory.api.feign.factory;

import cn.datax.service.data.factory.api.feign.DataSetServiceFeign;
import cn.datax.service.data.factory.api.feign.fallback.DataSetServiceFeignFallbackImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class DataSetServiceFeignFallbackFactory implements FallbackFactory<DataSetServiceFeign> {

    @Override
    public DataSetServiceFeign create(Throwable throwable) {
        DataSetServiceFeignFallbackImpl dataSetServiceFeignFallback = new DataSetServiceFeignFallbackImpl();
        dataSetServiceFeignFallback.setCause(throwable);
        return dataSetServiceFeignFallback;
    }
}
