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

Bug 237727

Summary: PartInitException could be more specific in ViewFactory.createView
Product: [Eclipse Project] Platform Reporter: Kevin McGuire <Kevin_McGuire>
Component: UIAssignee: Eric Moffatt <emoffatt>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: remy.suen
Version: 3.4   
Target Milestone: 3.5   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Kevin McGuire CLA 2008-06-18 23:10:40 EDT
ViewFactory.createView throws PartInitException.  The resulting message is:
   "Could not create view: <viewId>"

The failure is actually because the id is not in the view registry:

     IViewDescriptor desc = viewReg.find(id);
        // ensure that the view id is valid
        if (desc == null) {
			throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate,  id ));
		}

It would be helpful if the message was more specific as PartInitException can be thrown for a number of reasons.
Comment 1 Kevin McGuire CLA 2008-06-18 23:38:03 EDT
It could instead say:
"Could not find view ID: <viewId>"
Comment 2 Eric Moffatt CLA 2008-06-19 10:39:20 EDT
I'll take this one...it's a subset of the 'failures' should be more graceful defect which I hope to take a cut at in 3.5.
Comment 3 Eric Moffatt CLA 2009-03-05 14:16:47 EST
Marking as a DUP of the defect we're using to track dynamic plugin issues...


*** This bug has been marked as a duplicate of bug 218197 ***