DESCRIPTION

Fix error handling in some actions

Some missing error logging was added.

Signed-off-by: Marlie Beasley xxx@xxx.xxx

COMMENTS

author: Malia Sampson
date: 2010-04-26 16:15:08.000000000

Patch Set 1: No score; No score

One idea is that we take Activator.logError and make it a bit smarter so we can get rid of all those MessageDialog references everywhere... for example in PDE we do something like this in our activator...

	public static void logException(Throwable e, final String title, String message) {
		if (e instanceof InvocationTargetException) {
			e = ((InvocationTargetException) e).getTargetException();
		}
		IStatus status = null;
		if (e instanceof CoreException)
			status = ((CoreException) e).getStatus();
		else {
			if (message == null)
				message = e.getMessage();
			if (message == null)
				message = e.toString();
			status = new Status(IStatus.ERROR, getPluginId(), IStatus.OK, message, e);
		}
		ResourcesPlugin.getPlugin().getLog().log(status);
		Display display = SWTUtil.getStandardDisplay();
		final IStatus fstatus = status;
		display.asyncExec(new Runnable() {
			public void run() {
				ErrorDialog.openError(null, title, null, fstatus);
			}
		});
	}

-------------------------------------
author: Jaylon Avila
date: 2010-04-26 16:23:21.000000000

Patch Set 1: No score

Chris, I hope PDE is not actually logging errors to the org.eclipse.core.resources bundle but to your own bundles. ;)

With regards to showing errors, we should be using StatusManager instead of popping up MessageDialogs or ErrorDialogs. This allows customization at the product level for the handling statuses.

-------------------------------------
author: Malia Sampson
date: 2010-04-26 16:32:20.000000000

Patch Set 1:

When did StatusManager become API?

EGit still needs to run on 3.4 for the 3.6 release :/

-------------------------------------
author: Marlie Beasley
date: 2010-04-26 16:39:10.000000000

Patch Set 1: No score

Hi Chris,

one comment on the error handling code above: there are cases where the Status object of the CoreExeption does not contain a Throwable. In this case the call stack of the exception is not logged.
Exampe: TeamExecption constructor

	public TeamException(String message) {
		this(message, null);
	}

=> CoreException with status.getException() == null

-------------------------------------
author: Jaylon Avila
date: 2010-04-26 17:13:17.000000000

Patch Set 1:

Chris, we introduced org.eclipse.ui.statushandlers.StatusManager in 3.3.

-------------------------------------
author: Malia Sampson
date: 2010-04-26 21:52:55.000000000

Patch Set 1: I would prefer that you didn't submit this

Jens, can you look at using 'StatusManager' in the EGit code base instead?

-------------------------------------
author: Gerrit Johnathan Pham
date: 2010-04-27 13:14:22.000000000

Your change could not be merged due to a path conflict.

Please merge (or rebase) the change locally and upload the resolution for review.

-------------------------------------
