Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 388453

Summary: Creating same project name twice doesn't surface error
Product: [ECD] Orion Reporter: John Arthorne <john.arthorne>
Component: ClientAssignee: Susan McCourt <susan>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ken_walker, susan
Version: unspecified   
Target Milestone: 1.0 RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description John Arthorne CLA 2012-08-30 11:58:18 EDT
I20120829

- Create a new top level folder in the Navigator
- Create another folder with the same name

-> This correctly fails, but the error does not properly surface to the user. All I see in the Navigator is ! [object Object]
Comment 1 John Arthorne CLA 2012-10-01 11:49:09 EDT
Susan I am investigating this, but I am confused about how it is supposed to work. Throughout fileCommands.js, it uses an errorHandler object like this:

	function errorHandler(serviceRegistry, error) {
		var progress = serviceRegistry.getService("orion.page.progress"); //$NON-NLS-0$
		progress.setProgressResult(error);
	}

However when this is hooked up to the various deferred calls, it is only called with a single argument which is the error. This results in a Type Error in the above because there is no getService function on the error object.

It looks like you changed this here:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/diff/bundles/org.eclipse.orion.client.core/web/orion/fileCommands.js?id=e707eeae37a45bfe8fa8a8a0329c37c38b2e7a05

Before that commit, the error handler looked like this:

var errorHandler = function(error) {
  progress.setProgressResult(error);
};

I.e., the error object is the first argument, which is what I would expect since this is what is passed to the errBack in the deferred calls.
Comment 2 Susan McCourt CLA 2012-10-01 11:56:04 EDT
This looks like a very sloppy/incomplete refactoring on my part.  I needed to use the various utility methods outside the scope of their original function.  I'll take this and fix it.
Comment 3 Susan McCourt CLA 2012-10-01 12:28:27 EDT
Fixed in http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=e25201bef68b75050d3ab7b1da6b49f2c76cd18c

Verified that error now shows.  I'm retesting all the other progress and error handling in fileCommands in bug 361006.