public static IStatus openError(Shell providedShell, String title, String message, Throwable exception, int flags) {  if (exception instanceof InvocationTargetException) { Throwable target = ((InvocationTargetException)exception).getTargetException();  if (target instanceof RuntimeException) { throw (RuntimeException)target; } if (target instanceof Error) { throw (Error)target; } return openError(providedShell, title, message, target, flags); }   IStatus status = null; boolean log = false; if (exception instanceof CoreException) { status = ((CoreException)exception).getStatus(); log = ((flags & LOG_CORE_EXCEPTIONS) > 0); } else if (exception instanceof TeamException) { status = ((TeamException)exception).getStatus(); log = ((flags & LOG_TEAM_EXCEPTIONS) > 0); } else if (exception instanceof InterruptedException) { return new SVNStatus(IStatus.OK, Policy.bind("ok")); } else if (exception != null) { status = new SVNStatus(IStatus.ERROR, Policy.bind("internal"), exception); log = ((flags & LOG_OTHER_EXCEPTIONS) > 0); if (title == null) title = Policy.bind("SimpleInternal"); }   if (status.getCode() == IResourceStatus.BUILD_FAILED) { message = Policy.bind("buildError"); log = true; }   if (status.isMultiStatus() && status.getChildren().length == 1) { status = status.getChildren()[0]; } if (status.isOK()) return status;   if (log) SVNUIPlugin.log(status);   final String displayTitle = title; final String displayMessage = message; final IStatus displayStatus = status; final IOpenableInShell openable = new IOpenableInShell() { public void open(Shell shell) { if (displayStatus.getSeverity() == IStatus.INFO && !displayStatus.isMultiStatus()) { MessageDialog.openInformation(shell, Policy.bind("information"), displayStatus.getMessage()); } else { ErrorDialog.openError(shell, displayTitle, displayMessage, displayStatus); } } }; openDialog(providedShell, openable, flags);   return status;
public static IStatus openError(Shell shell, String title, String message, Throwable exception) { return openError(shell, title, message, exception, LOG_OTHER_EXCEPTIONS);
	public static IStatus openError(Shell providedShell, String title, String message, Throwable exception, int flags) {		// Unwrap InvocationTargetExceptions		if (exception instanceof InvocationTargetException) {			Throwable target = ((InvocationTargetException)exception).getTargetException();			// re-throw any runtime exceptions or errors so they can be handled by the workbench			if (target instanceof RuntimeException) {				throw (RuntimeException)target;			}			if (target instanceof Error) {				throw (Error)target;			} 			return openError(providedShell, title, message, target, flags);		}				// Determine the status to be displayed (and possibly logged)		IStatus status = null;		boolean log = false;		if (exception instanceof CoreException) {			status = ((CoreException)exception).getStatus();			log = ((flags & LOG_CORE_EXCEPTIONS) > 0);		} else if (exception instanceof TeamException) {			status = ((TeamException)exception).getStatus();			log = ((flags & LOG_TEAM_EXCEPTIONS) > 0);		} else if (exception instanceof InterruptedException) {			return new SVNStatus(IStatus.OK, Policy.bind("ok")); //$NON-NLS-1$		} else if (exception != null) {			status = new SVNStatus(IStatus.ERROR, Policy.bind("internal"), exception); //$NON-NLS-1$			log = ((flags & LOG_OTHER_EXCEPTIONS) > 0);			if (title == null) title = Policy.bind("SimpleInternal"); //$NON-NLS-1$		}				// Check for a build error and report it differently		if (status.getCode() == IResourceStatus.BUILD_FAILED) {			message = Policy.bind("buildError"); //$NON-NLS-1$			log = true;		}				// Check for multi-status with only one child		if (status.isMultiStatus() && status.getChildren().length == 1) {			status = status.getChildren()[0];		}		if (status.isOK()) return status;				// Log if the user requested it		if (log) SVNUIPlugin.log(status);				// Create a runnable that will display the error status		final String displayTitle = title;		final String displayMessage = message;		final IStatus displayStatus = status;		final IOpenableInShell openable = new IOpenableInShell() {			public void open(Shell shell) {				if (displayStatus.getSeverity() == IStatus.INFO && !displayStatus.isMultiStatus()) {					MessageDialog.openInformation(shell, Policy.bind("information"), displayStatus.getMessage()); //$NON-NLS-1$				} else {					ErrorDialog.openError(shell, displayTitle, displayMessage, displayStatus);				}			}		};		openDialog(providedShell, openable, flags);				// return the status we display		return status;	}