Example usage for org.springframework.core NestedExceptionUtils getMostSpecificCause

List of usage examples for org.springframework.core NestedExceptionUtils getMostSpecificCause

Introduction

In this page you can find the example usage for org.springframework.core NestedExceptionUtils getMostSpecificCause.

Prototype

public static Throwable getMostSpecificCause(Throwable original) 

Source Link

Document

Retrieve the most specific cause of the given exception, that is, either the innermost cause (root cause) or the exception itself.

Usage

From source file:org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler.java

private boolean isDisconnectedClientError(Throwable ex) {
    return DISCONNECTED_CLIENT_EXCEPTIONS.contains(ex.getClass().getSimpleName())
            || isDisconnectedClientErrorMessage(NestedExceptionUtils.getMostSpecificCause(ex).getMessage());
}

From source file:org.springframework.web.server.adapter.HttpWebHandlerAdapter.java

private boolean isDisconnectedClientError(Throwable ex) {
    String message = NestedExceptionUtils.getMostSpecificCause(ex).getMessage();
    message = (message != null ? message.toLowerCase() : "");
    String className = ex.getClass().getSimpleName();
    return (message.contains("broken pipe") || DISCONNECTED_CLIENT_EXCEPTIONS.contains(className));
}

From source file:org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.java

private boolean indicatesDisconnectedClient(Throwable ex) {
    String message = NestedExceptionUtils.getMostSpecificCause(ex).getMessage();
    message = (message != null ? message.toLowerCase() : "");
    String className = ex.getClass().getSimpleName();
    return (message.contains("broken pipe") || DISCONNECTED_CLIENT_EXCEPTIONS.contains(className));
}