Skip to content

Commit

Permalink
Update Netty error wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane Maldini committed May 9, 2019
1 parent 5059f86 commit 5ee6151
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/main/java/reactor/netty/ReactorNetty.java
Expand Up @@ -168,7 +168,7 @@ public static String format(Channel channel, String msg) {
* @return a wrapped {@link RuntimeException}
*/
public static RuntimeException wrapException(Throwable throwable) {
return new ReactorNettyException(Objects.requireNonNull(throwable));
return new InternalNettyException(Objects.requireNonNull(throwable));
}

static void addChunkedWriter(Connection c){
Expand Down Expand Up @@ -765,15 +765,15 @@ public Mono<Void> then() {
};
}

static final class ReactorNettyException extends RuntimeException {
static final class InternalNettyException extends RuntimeException {

ReactorNettyException(Throwable cause) {
InternalNettyException(Throwable cause) {
super(cause);
}

@Override
public synchronized Throwable fillInStackTrace() {
return getCause().fillInStackTrace();
return this;
}
}

Expand Down
12 changes: 0 additions & 12 deletions src/main/java/reactor/netty/channel/AbortedException.java
Expand Up @@ -31,10 +31,6 @@ public AbortedException(String message) {
super(message);
}

public AbortedException(Throwable cause) {
super(cause);
}

/**
* Return true if connection has been simply aborted on a tcp level by verifying if
* the given inbound error.
Expand All @@ -54,12 +50,4 @@ public static boolean isConnectionReset(Throwable err) {
err.getMessage()
.contains("Connection reset by peer"));
}

@Override
public synchronized Throwable fillInStackTrace() {
if (getCause() != null) {
return getCause().fillInStackTrace();
}
return this;
}
}

0 comments on commit 5ee6151

Please sign in to comment.