Examples of ExceptionToCatch


Examples of org.jboss.seam.exception.control.ExceptionToCatch

            chain.doFilter(request, response);
        } else {
            try {
                chain.doFilter(request, response);
            } catch (Exception e) {
                ExceptionToCatch catchEvent;
                if (request instanceof HttpServletRequest) {
                    catchEvent = new ExceptionToCatch(e, WebRequestLiteral.INSTANCE);
                    // new PathLiteral(HttpServletRequest.class.cast(request).getServletPath()));
                } else {
                    catchEvent = new ExceptionToCatch(e, WebRequestLiteral.INSTANCE);
                }
                getBeanManager().fireEvent(catchEvent);
                // QUESTION should catch handle rethrowing?
                if (!catchEvent.isHandled()) {
                    if (e instanceof ServletException) {
                        throw (ServletException) e;
                    } else if (e instanceof IOException) {
                        throw (IOException) e;
                    } else {
View Full Code Here

Examples of org.jboss.seam.exception.control.ExceptionToCatch

        for (Iterator<ExceptionQueuedEvent> it = getUnhandledExceptionQueuedEvents().iterator(); it.hasNext();) {
            Throwable t = it.next().getContext().getException();
            log.trace(MessageFormat.format("Handling Exception {0}", t.getClass().getName()));
            if (!(t instanceof AbortProcessingException)) // Why is this needed
            {
                ExceptionToCatch catchEvent = new ExceptionToCatch(t, FacesLiteral.INSTANCE);
                try {
                    if (log.isTraceEnabled()) {
                        log.trace("Firing event");
                    }
                    beanManager.fireEvent(catchEvent);
                } catch (Exception e) {
                    if (!e.equals(t)) {
                        log.debug("Throwing exception thrown from within Seam Catch");
                        throw new RuntimeException(e);
                    }
                    continue; // exception will be handled by getWrapped().handle() below
                }
                if (catchEvent.isHandled()) {
                    log.debug(MessageFormat.format("Exception handled {0}", t.getClass().getName()));
                    it.remove();
                }
            }
        }
View Full Code Here

Examples of org.jboss.seam.exception.control.ExceptionToCatch

    private static final Logger log = Logger.getLogger(CatchExceptionMapper.class);

    @Override
    public Response toResponse(Throwable exception) {
        ExceptionToCatch payload = new ExceptionToCatch(exception, RestRequest.RestRequestLiteral.INSTANCE);

        // The call returns if the exception is handled. The exception is rethrown by catch otherwise.
        bridgeEvent.fire(payload);

        return response.get();
View Full Code Here

Examples of org.jboss.solder.exception.control.ExceptionToCatch

            final NavigationEnum nav = NavigationEnum.valueOf(uri.substring(uri.lastIndexOf("/") + 1).toUpperCase());

            throw new ServletException(nav.getException()); // wrapping because we don't want to try / catch and we can't add
            // the throws list
        } catch (IllegalArgumentException e) {
            this.catchEvent.fire(new ExceptionToCatch(e)); // If there is no catch integration, this is how to add basic
            // integration yourself
        }
    }
View Full Code Here

Examples of org.jboss.solder.exception.control.ExceptionToCatch

    public void handle() throws FacesException {
        log.trace("Handling Exceptions");
        for (Iterator<ExceptionQueuedEvent> it = getUnhandledExceptionQueuedEvents().iterator(); it.hasNext();) {
            Throwable t = it.next().getContext().getException();
            log.trace(MessageFormat.format("Handling Exception {0}", t.getClass().getName()));
            ExceptionToCatch catchEvent = new ExceptionToCatch(t, FacesLiteral.INSTANCE);
            try {
                if (log.isTraceEnabled()) {
                    log.trace("Firing event");
                }
                beanManager.fireEvent(catchEvent);
            } catch (Exception e) {
                if (!e.equals(t)) {
                    log.debug("Throwing exception thrown from within Seam Catch");
                    throw new RuntimeException(e);
                }
                continue; // exception will be handled by getWrapped().handle() below
            }
            if (catchEvent.isHandled()) {
                log.debug(MessageFormat.format("Exception handled {0}", t.getClass().getName()));
                it.remove();
            }
        }
        if (getUnhandledExceptionQueuedEvents().iterator().hasNext()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.