/** * @param context * @param ex * @throws IOException * @throws ServletException */ public void handleException(final FacesContext context, final Exception ex) { //besoin d'exposer la requête pour y mettre dans la session le ExceptionService PortletRequest request = (PortletRequest) context.getExternalContext().getRequest(); ContextUtils.exposeRequest(request); ExceptionUtils.markExceptionCaught(); ExceptionService e = null; // try { e = ExceptionUtils.catchException(ex); // } catch (Throwable t) { // handleExceptionHandlingException(t); // // never reached, prevent from warnings // return; // } ExceptionUtils.markExceptionCaught(e); ContextUtils.unexposeRequest(request); NavigationHandler navigation = context.getApplication().getNavigationHandler(); // Redirection vers la page des erreurs navigation.handleNavigation(context, "", e.getExceptionView()); }
logger.debug("------------------- markExceptionCaught -------------------"); ExceptionUtils.markExceptionCaught(); ExceptionUtils.markExceptionCaught(exceptionService);