Example usage for org.apache.commons.lang3.exception ExtendedExceptionUtils toRuntimeException

List of usage examples for org.apache.commons.lang3.exception ExtendedExceptionUtils toRuntimeException

Introduction

In this page you can find the example usage for org.apache.commons.lang3.exception ExtendedExceptionUtils toRuntimeException.

Prototype

public static final RuntimeException toRuntimeException(Throwable e, boolean peelWrapper) 

Source Link

Usage

From source file:net.community.chest.gitcloud.facade.AbstractEnvironmentInitializer.java

@Override
public void contextInitialized(ServletContextEvent sce) {
    Log curLogger = logger;/*from  www. j  av  a  2 s . c o m*/
    try {
        ServletContext context = sce.getServletContext();
        logger = ServletUtils.wrapServletContext(context, Level.CONFIG);
        contextInitialized(context);
        logger.info("contextInitialized(" + context.getContextPath() + ")");
    } catch (Throwable t) {
        logger.error("Failed (" + t.getClass().getSimpleName() + ") to initialize: " + t.getMessage(), t);
        throw ExtendedExceptionUtils.toRuntimeException(t, true);
    } finally {
        logger = curLogger;
    }
}

From source file:net.community.chest.gitcloud.facade.AbstractEnvironmentInitializer.java

@Override
public void contextDestroyed(ServletContextEvent sce) {
    Log curLogger = logger;//from w ww .j a  v  a  2s .c o  m
    try {
        ServletContext context = sce.getServletContext();
        logger = ServletUtils.wrapServletContext(context, Level.CONFIG);
        contextDestroyed(context);
        logger.info("contextDestroyed(" + context.getContextPath() + ")");
    } catch (Throwable t) {
        logger.error("Failed (" + t.getClass().getSimpleName() + ") to destroy: " + t.getMessage(), t);
        throw ExtendedExceptionUtils.toRuntimeException(t, true);
    } finally {
        logger = curLogger;
    }
}

From source file:org.springframework.core.convert.support.StringToClassConverter.java

@Override
public Class<?> convert(String className) {
    if (!StringUtils.hasLength(className)) {
        return null;
    }/*from  w w  w .  j a v  a  2 s .co  m*/

    try {
        return ClassUtils.forName(className, getLoader());
    } catch (Throwable t) {
        throw ExtendedExceptionUtils.toRuntimeException(t, true);
    }
}