1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

Polish alibaba/spring-cloud-alibaba/#1132 : [Nacos Discovery] NacosServiceRegistry throw Exception when register failed

This commit is contained in:
mercyblitz 2020-02-04 13:51:00 +08:00
parent cd96dd968b
commit 6b3b017209

View File

@ -28,6 +28,8 @@ import org.springframework.cloud.client.serviceregistry.Registration;
import org.springframework.cloud.client.serviceregistry.ServiceRegistry;
import org.springframework.util.StringUtils;
import static org.springframework.util.ReflectionUtils.rethrowRuntimeException;
/**
* @author xiaojing
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
@ -66,6 +68,9 @@ public class NacosServiceRegistry implements ServiceRegistry<Registration> {
catch (Exception e) {
log.error("nacos registry, {} register failed...{},", serviceId,
registration.toString(), e);
// rethrow a RuntimeException if the registration is failed.
// issue : https://github.com/alibaba/spring-cloud-alibaba/issues/1132
rethrowRuntimeException(e);
}
}