do
{
// For each ExceptionEvent in the list
// get the event to handle
ExceptionQueuedEvent event = unhandled.peek();
try
{
// call its getContext() method
ExceptionQueuedEventContext context = event.getContext();
if (facesContext == null)
{
facesContext = event.getContext().getContext();
}
// and call getException() on the returned result
Throwable exception = context.getException();