diff --git a/transport/src/main/java/io/netty/channel/AbstractChannel.java b/transport/src/main/java/io/netty/channel/AbstractChannel.java index ad671423df..11c14a9624 100644 --- a/transport/src/main/java/io/netty/channel/AbstractChannel.java +++ b/transport/src/main/java/io/netty/channel/AbstractChannel.java @@ -170,6 +170,8 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha if (localAddress == null) { try { this.localAddress = localAddress = unsafe().localAddress(); + } catch (Error e) { + throw e; } catch (Throwable t) { // Sometimes fails on a closed socket in Windows. return null; @@ -192,6 +194,8 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha if (remoteAddress == null) { try { this.remoteAddress = remoteAddress = unsafe().remoteAddress(); + } catch (Error e) { + throw e; } catch (Throwable t) { // Sometimes fails on a closed socket in Windows. return null;