Package com.cedarsolutions.exception.context

Examples of com.cedarsolutions.exception.context.IHasExceptionContext


     * @return The same exception, for convenience.
     */
    @SuppressWarnings("unchecked")
    public static <T> T addExceptionContext(Throwable exception, int level) {
        if (exception instanceof IHasExceptionContext) {
            IHasExceptionContext hasContext = (IHasExceptionContext) exception;
            ExceptionContext context = generateExceptionContext(exception, level);
            hasContext.setContext(context);
        }

        return (T) exception;
    }
View Full Code Here


     */
    public static String generateStackTrace(Throwable exception) {
        if (exception == null) {
            return null;
        } else if (exception instanceof IHasExceptionContext) {
            IHasExceptionContext hasContext = (IHasExceptionContext) exception;
            if (hasContext.getContext() != null && hasContext.getContext().getStackTrace() != null) {
                return hasContext.getContext().getStackTrace();
            } else {
                return generateStackTraceText(exception);
            }
        } else {
            return generateStackTraceText(exception);
View Full Code Here

TOP

Related Classes of com.cedarsolutions.exception.context.IHasExceptionContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.