当前位置: 首页>>代码示例>>Java>>正文


Java NestedCheckedException类代码示例

本文整理汇总了Java中org.springframework.core.NestedCheckedException的典型用法代码示例。如果您正苦于以下问题:Java NestedCheckedException类的具体用法?Java NestedCheckedException怎么用?Java NestedCheckedException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NestedCheckedException类属于org.springframework.core包,在下文中一共展示了NestedCheckedException类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: logWriteFrameFailure

import org.springframework.core.NestedCheckedException; //导入依赖的package包/类
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);
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:21,代码来源:AbstractSockJsSession.java

示例2: serverNotRunning

import org.springframework.core.NestedCheckedException; //导入依赖的package包/类
@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;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:13,代码来源:SampleLiquibaseApplicationTests.java

示例3: serverNotRunning

import org.springframework.core.NestedCheckedException; //导入依赖的package包/类
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;
	}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:12,代码来源:SampleSolrApplicationTests.java

示例4: serverNotRunning

import org.springframework.core.NestedCheckedException; //导入依赖的package包/类
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;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:13,代码来源:SampleCouchbaseApplicationTests.java

示例5: serverNotRunning

import org.springframework.core.NestedCheckedException; //导入依赖的package包/类
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;
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:13,代码来源:SampleLiquibaseApplicationTests.java

示例6: afterInitialized

import org.springframework.core.NestedCheckedException; //导入依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:carewebframework,项目名称:carewebframework-core,代码行数:65,代码来源:ExceptionController.java


注:本文中的org.springframework.core.NestedCheckedException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。