I have an init method on my @ViewScoped mananged bean. In the post construct i load data from the db. I have a custom ExceptionHandlerWrapper to catch all excptions and send to an error pages. However when @PostConstuct throws an exception i recieve an IllegalStateException and am not redirected to the error page. I have tried many combinations.....
Ive tried this inside my ExcpetionHandler
externalContext.getRequestMap().put(ERROR_BEAN_ID, ERROR_TEXT);
externalContext.dispatch(ERROR_PAGE);
fc.responseComplete();
This line below is what i originally had. It also doent work
externalContext.getFlash().put(ERROR_BEAN_ID, ERROR_TEXT);
nav.handleNavigation(fc, null, ERROR_PAGE);
fc.renderResponse();
These all cause IllegalStateExceptions. I also called redirect with the same result.
Can you globally catch errors thrown from @PostConstruct?