Thanks for the example. But as mentioned in the original post, getWorkbench().close() doesn't work in this case because the workbench may not have been initialized yet (e.g. if the failure occurs in a non-UI bundle that the UI bundle depends on).