Skip to content

Commit

Permalink
Merge branch '2.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Apr 3, 2019
2 parents 5c4537a + 0b828db commit edb5937
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public abstract class AbstractErrorWebExceptionHandler
* Currently duplicated from Spring WebFlux HttpWebHandlerAdapter.
*/
private static final Set<String> DISCONNECTED_CLIENT_EXCEPTIONS = new HashSet<>(
Arrays.asList("ClientAbortException", "EOFException", "EofException"));
Arrays.asList("AbortedException", "ClientAbortException", "EOFException",
"EofException"));

private static final Log logger = HttpLogging
.forLogName(AbstractErrorWebExceptionHandler.class);
Expand Down Expand Up @@ -268,8 +269,12 @@ public Mono<Void> handle(ServerWebExchange exchange, Throwable throwable) {

private boolean isDisconnectedClientError(Throwable ex) {
String message = NestedExceptionUtils.getMostSpecificCause(ex).getMessage();
if (message != null && message.toLowerCase().contains("broken pipe")) {
return true;
if (message != null) {
String text = message.toLowerCase();
if (text.contains("broken pipe")
|| text.contains("connection reset by peer")) {
return true;
}
}
return DISCONNECTED_CLIENT_EXCEPTIONS.contains(ex.getClass().getSimpleName());
}
Expand Down

0 comments on commit edb5937

Please sign in to comment.