Bug 78222 [JFace] ModalContext event loop should guard against SWTExceptions
I was generating a patch and clicking Finish on the wizard would not close the wizard even though the patch was created succesfully. It turned out that the problem was that writing to the console caused an error due to word wrap being on. There are two problems here. There was no error message shown to the user and writing to the console should not cause a command to fail.
bundles/org.eclipse.jface/src/org/eclipse/jface/operation/ModalContext.java
} catch (RuntimeException e) {
            throw new InvocationTargetException(e);
        } catch (Error e) {
            throw new InvocationTargetException(e);
        }
    }
    /**
     * Sets whether ModalContext is running in debug mode.
     *
     * @param debugMode <code>true</code> for debug mode, 
     *  and <code>false</code> for normal mode (the default)
     */
    public static void setDebugMode(boolean debugMode) {
        debug = debugMode;
    }
	/**
	 * Sets whether ModalContext may process events (by calling <code>Display.readAndDispatch()</code>)
	 * while running operations. By default, ModalContext will process events while running operations.
	 * Use this method to disallow event processing temporarily.
	 * @param allowReadAndDispatch <code>true</code> (the default) if events may be processed while
	 * running an operation, <code>false</code> if Display.readAndDispatch() should not be called
	 * from ModalContext.
	 * @since 3.2
	 */
	public static void setAllowReadAndDispatch(boolean allowReadAndDispatch) {
		
		runInSeparateThread = allowReadAndDispatch;
	}
}