Fix the UnknownHostException is swallowed (#3495)
This commit is contained in:
parent
4310b3ee47
commit
b79f048a9b
@ -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) + (
|
||||
|
Loading…
Reference in New Issue
Block a user