List of usage examples for org.springframework.core NestedCheckedException getMostSpecificCause
public Throwable getMostSpecificCause()
From source file:org.springframework.web.server.handler.ExceptionHandlingWebHandler.java
private void logException(Throwable ex) { @SuppressWarnings("serial") NestedCheckedException nestedException = new NestedCheckedException("", ex) { };/*from w w w .j a va 2s . c o m*/ if ("Broken pipe".equalsIgnoreCase(nestedException.getMostSpecificCause().getMessage()) || DISCONNECTED_CLIENT_EXCEPTIONS.contains(ex.getClass().getSimpleName())) { if (disconnectedClientLogger.isTraceEnabled()) { disconnectedClientLogger.trace("Looks like the client has gone away", ex); } else if (disconnectedClientLogger.isDebugEnabled()) { disconnectedClientLogger.debug("Looks like the client has gone away: " + nestedException.getMessage() + " (For full stack trace, set the '" + DISCONNECTED_CLIENT_LOG_CATEGORY + "' log category to TRACE level)"); } } else { logger.error("Could not complete request", ex); } }