Bug 210946 [Workbench] Unproper error handling in class ModalContext
Build ID: M20070921-1145 Steps To Reproduce: A caught Throwable is not written to the Eclipse log. It is just written on the console. org.eclipse.jface.operation.ModalContext public void block() { if (display == Display.getCurrent()) { while (continueEventDispatching) { // Run the event loop. Handle any uncaught exceptions caused // by UI events. try { if (!display.readAndDispatch()) { display.sleep(); } } // ThreadDeath is a normal error when the thread is dying. We must // propagate it in order for it to properly terminate. catch (ThreadDeath e) { throw (e); } // For all other exceptions, log the problem. catch (Throwable e) { System.err.println("Unhandled event loop exception during blocked modal context."); //$NON-NLS-1$ e.printStackTrace(); } More information:
bundles/org.eclipse.jface/src/org/eclipse/jface/operation/ModalContext.java
/*******************************************************************************
 * Copyright (c) 2000, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jface.operation;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.ProgressMonitorWrapper;
import org.eclipse.core.runtime.Assert;
import org.eclipse.swt.widgets.Display;
/**
 * Utility class for supporting modal operations. The runnable passed to the
 * <code>run</code> method is executed in a separate thread, depending on the
 * value of the passed fork argument. If the runnable is executed in a separate
 * thread then the current thread either waits until the new thread ends or, if
 * the current thread is the UI thread, it polls the SWT event queue and
 * dispatches each event.
 * <p>
 * This class is not intended to be subclassed.
 * </p>
 */
public class ModalContext {