From b79f048a9bbb3c16ba44d5957e64484b18a091f9 Mon Sep 17 00:00:00 2001 From: ljhrot <296093710@qq.com> Date: Sun, 2 Aug 2020 18:59:58 +0800 Subject: [PATCH] Fix the UnknownHostException is swallowed (#3495) --- .../nacos/core/distributed/id/SnowFlowerIdGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/com/alibaba/nacos/core/distributed/id/SnowFlowerIdGenerator.java b/core/src/main/java/com/alibaba/nacos/core/distributed/id/SnowFlowerIdGenerator.java index f8db27cb5..7f483e987 100644 --- a/core/src/main/java/com/alibaba/nacos/core/distributed/id/SnowFlowerIdGenerator.java +++ b/core/src/main/java/com/alibaba/nacos/core/distributed/id/SnowFlowerIdGenerator.java @@ -88,7 +88,7 @@ public class SnowFlowerIdGenerator implements IdGenerator { try { address = InetAddress.getLocalHost(); } catch (final UnknownHostException e) { - throw new IllegalStateException("Cannot get LocalHost InetAddress, please check your network!"); + throw new IllegalStateException("Cannot get LocalHost InetAddress, please check your network!", e); } byte[] ipAddressByteArray = address.getAddress(); this.workerId = (((ipAddressByteArray[ipAddressByteArray.length - 2] & 0B11) << Byte.SIZE) + (