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