}
public static CoreException toCoreException(Throwable e) {
if (e instanceof CloudFoundryException) {
if (((CloudFoundryException) e).getDescription() != null) {
return new CoreException(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID, NLS.bind("{0} ({1})", //$NON-NLS-1$
((CloudFoundryException) e).getDescription(), e.getMessage()), e));
}
}
return new CoreException(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID, NLS.bind(
Messages.ERROR_PERFORMING_CLOUD_FOUNDRY_OPERATION, e.getMessage()), e));
}