package jnpf.account.fallback;

import feign.FeignException;
import feign.Request;
import jnpf.account.PTenantAccountApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class PTenantAccountApiFallBackFactory implements FallbackFactory<PTenantAccountApi> {

    @Override
    public PTenantAccountApi create(Throwable cause) {
        log.error("服务降级了");
        cause.printStackTrace();
        log.error(cause.getMessage(), cause);
        return new PTenantAccountApiFallBack();
    }

}
