Java 类org.springframework.core.NestedCheckedException 实例源码

项目:spring4-understanding    文件:AbstractSockJsSession.java   
private void logWriteFrameFailure(Throwable failure) {
    @SuppressWarnings("serial")
    NestedCheckedException nestedException = new NestedCheckedException("", failure) {};

    if ("Broken pipe".equalsIgnoreCase(nestedException.getMostSpecificCause().getMessage()) ||
            disconnectedClientExceptions.contains(failure.getClass().getSimpleName())) {

        if (disconnectedClientLogger.isTraceEnabled()) {
            disconnectedClientLogger.trace("Looks like the client has gone away", failure);
        }
        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.debug("Terminating connection after failure to send message to client", failure);
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SampleLiquibaseApplicationTests.java   
@SuppressWarnings("serial")
private boolean serverNotRunning(IllegalStateException ex) {
    NestedCheckedException nested = new NestedCheckedException("failed", ex) {
    };
    if (nested.contains(ConnectException.class)) {
        Throwable root = nested.getRootCause();
        if (root.getMessage().contains("Connection refused")) {
            return true;
        }
    }
    return false;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SampleSolrApplicationTests.java   
private boolean serverNotRunning(IllegalStateException ex) {

        @SuppressWarnings("serial")
        NestedCheckedException nested = new NestedCheckedException("failed", ex) {
        };
        Throwable root = nested.getRootCause();
        if (root.getMessage().contains("Connection refused")) {
            return true;
        }
        return false;
    }
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SampleCouchbaseApplicationTests.java   
private boolean serverNotRunning(RuntimeException ex) {
    @SuppressWarnings("serial")
    NestedCheckedException nested = new NestedCheckedException("failed", ex) {
    };
    if (nested.contains(ConnectException.class)) {
        Throwable root = nested.getRootCause();
        if (root.getMessage().contains("Connection refused")) {
            return true;
        }
    }
    return false;
}
项目:spring-boot-concourse    文件:SampleLiquibaseApplicationTests.java   
@SuppressWarnings("serial")
private boolean serverNotRunning(IllegalStateException ex) {
    NestedCheckedException nested = new NestedCheckedException("failed", ex) {
    };
    if (nested.contains(ConnectException.class)) {
        Throwable root = nested.getRootCause();
        if (root.getMessage().contains("Connection refused")) {
            return true;
        }
    }
    return false;
}
项目:spring-boot-concourse    文件:SampleSolrApplicationTests.java   
private boolean serverNotRunning(IllegalStateException ex) {

        @SuppressWarnings("serial")
        NestedCheckedException nested = new NestedCheckedException("failed", ex) {
        };
        Throwable root = nested.getRootCause();
        if (root.getMessage().contains("Connection refused")) {
            return true;
        }
        return false;
    }
项目:spring-boot-concourse    文件:SampleCouchbaseApplicationTests.java   
private boolean serverNotRunning(RuntimeException ex) {
    @SuppressWarnings("serial")
    NestedCheckedException nested = new NestedCheckedException("failed", ex) {
    };
    if (nested.contains(ConnectException.class)) {
        Throwable root = nested.getRootCause();
        if (root.getMessage().contains("Connection refused")) {
            return true;
        }
    }
    return false;
}
项目:contestparser    文件:SampleLiquibaseApplicationTests.java   
private boolean serverNotRunning(IllegalStateException ex) {
    @SuppressWarnings("serial")
    NestedCheckedException nested = new NestedCheckedException("failed", ex) {
    };
    if (nested.contains(ConnectException.class)) {
        Throwable root = nested.getRootCause();
        if (root.getMessage().contains("Connection refused")) {
            return true;
        }
    }
    return false;
}
项目:contestparser    文件:SampleSolrApplicationTests.java   
private boolean serverNotRunning(IllegalStateException ex) {

        @SuppressWarnings("serial")
        NestedCheckedException nested = new NestedCheckedException("failed", ex) {
        };
        Throwable root = nested.getRootCause();
        if (root.getMessage().contains("Connection refused")) {
            return true;
        }
        return false;
    }
项目:contestparser    文件:SampleElasticsearchApplicationTests.java   
private boolean serverNotRunning(IllegalStateException ex) {
    @SuppressWarnings("serial")
    NestedCheckedException nested = new NestedCheckedException("failed", ex) {
    };
    if (nested.contains(ConnectException.class)) {
        Throwable root = nested.getRootCause();
        if (root.getMessage().contains("Connection refused")) {
            return true;
        }
    }
    return false;
}
项目:carewebframework-core    文件:ExceptionController.java   
/**
 * Populate the display with information from the current execution.
 */
@Override
public void afterInitialized(BaseComponent comp) {
    //ClientUtil.busy(null, null);
    root = comp.getAncestor(Window.class);
    HttpServletRequest req = RequestUtil.getRequest();

    if (root == null || req == null) {
        return;
    }

    Class<?> errClass = (Class<?>) req.getAttribute(WebUtils.ERROR_EXCEPTION_TYPE_ATTRIBUTE);
    String errMsg = (String) req.getAttribute(WebUtils.ERROR_MESSAGE_ATTRIBUTE);
    Throwable err = (Throwable) req.getAttribute(WebUtils.ERROR_EXCEPTION_ATTRIBUTE);

    String errReqURI = (String) req.getAttribute(WebUtils.ERROR_REQUEST_URI_ATTRIBUTE);
    String errServletName = (String) req.getAttribute(WebUtils.ERROR_SERVLET_NAME_ATTRIBUTE);
    Integer errStatusCode = (Integer) req.getAttribute(WebUtils.ERROR_STATUS_CODE_ATTRIBUTE);

    String throwableContext = null;

    if (err != null) {
        if (err instanceof IThrowableContext) {
            throwableContext = ((IThrowableContext) err).getThrowableContext();
        }

        //stack trace info
        if (err instanceof NestedCheckedException) {
            err = ((NestedCheckedException) err).getMostSpecificCause();
        } else if (err instanceof NestedRuntimeException) {
            err = ((NestedRuntimeException) err).getMostSpecificCause();
        }
    }
    if (err != null) {
        errClass = errClass == null ? err.getClass() : errClass;
        errMsg = StringUtils.trimToNull(errMsg) == null ? err.getMessage() : errMsg;
    }

    StringBuffer buffer = new StringBuffer();
    //generic exception info
    buffer.append("\nException class: ").append(errClass);
    buffer.append("\nMessage: ").append(errMsg);
    buffer.append("\nStatusCode: ").append(errStatusCode);
    buffer.append("\nServletName: ").append(errServletName);
    buffer.append("\nReqURI: ").append(errReqURI);

    Map<String, Object> browserInfo = ExecutionContext.getPage().getBrowserInfo();
    buffer.append(browserInfo);

    buffer.append("\nThrowableContext: " + throwableContext);
    buffer.append("\nStackTrace: ");
    appendStackTrace(err);

    log.error(buffer, err);
    this.lblExceptionClass.setLabel(String.valueOf(errClass));
    this.lblMessage.setLabel(errMsg);
    this.lblStatusCode.setLabel(String.valueOf(errStatusCode));

    if (SecurityUtil.isGrantedAny(StrUtil.getLabel("cwf.error.dialog.expanded"))) {
        setDetail(true);
    }
}