Package org.apache.wink.common.internal.application

Examples of org.apache.wink.common.internal.application.ApplicationExceptionAttribute


                        .getMessage("processingRequestTo", requestMethod, requestString, request.getContentType(), request.getHeader("Accept"))); //$NON-NLS-1$ $NON-NLS-2$
            }
            handleRequestWithoutFaultBarrier(request, response);
        } catch (Throwable t) {
            // exception was not handled properly
            ApplicationExceptionAttribute appEx = null;
            RuntimeContext runtimeContext = RuntimeContextTLS.getRuntimeContext();
            if (runtimeContext != null) {
                appEx = runtimeContext.getAttribute(ApplicationExceptionAttribute.class);
            }
            if (appEx != null && (appEx.getDebugMsg() != null)) {
                // This exception originated from an application class, such as a resource or provider
                // See unittest class DebugResourceThrowsExceptionTest.
                if (logger.isDebugEnabled()) {
                    logger.debug(appEx.getDebugMsg());
                }
                // although we may not have actually called the logger, we want to prevent logging sensitive application stack
                alreadyLogged = true;
            } else {
                if (logger.isTraceEnabled()) {
View Full Code Here


            }
        }
    }

    private void logException(Throwable t, HttpServletRequest request) {
        ApplicationExceptionAttribute appEx = RuntimeContextTLS.getRuntimeContext().getAttribute(ApplicationExceptionAttribute.class);
       
        if (appEx != null && (appEx.getDebugMsg() != null)) {
            // This exception originated from an application class, such as a resource or provider
            // See unittest class DebugResourceThrowsExceptionTest.
            if (logger.isDebugEnabled()) {
                logger.debug(appEx.getDebugMsg());
            }
            // although we may not have actually called the logger, we want to prevent logging sensitive application stack
            alreadyLogged = true;
            return;
        }
View Full Code Here

            }
            String newLine = System.getProperty("line.separator"); //$NON-NLS-1$
            debugMsgFormat += " )" + newLine + "%s";

            String debugMsg = String.format(debugMsgFormat, dataToFormattedString.toArray(new Object[]{}));
            context.setAttribute(ApplicationExceptionAttribute.class, new ApplicationExceptionAttribute(debugMsg));
        } catch (Throwable t) {
            // just to be extra super duper cautious.  It'll still be logged, just not via the format above.
            logger.trace("Could not format log output for exception originating in provider.", t);
        }
    }
View Full Code Here

                        // send exception through stackToString because it may have been intentionally thrown
                        // from resource method; we don't want to scare the log readers, so it's recorded as DEBUG
                        LogUtils.stackToDebugString(ite.getTargetException())
                        }
                );
                context.setAttribute(ApplicationExceptionAttribute.class, new ApplicationExceptionAttribute(debugMsg));
            } catch (Throwable t) {
                // just to be extra super duper cautious.  It'll still be logged, just not via the format above.
                logger.trace("Could not format log output for exception originating in provider.", t);
            }
               
View Full Code Here

TOP

Related Classes of org.apache.wink.common.internal.application.ApplicationExceptionAttribute

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.