| Summary: | PartServiceImpl.savePart doesn't use WorkbenchAdvisor.getWorkbenchErrorHandler() | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Arnaud Brunet <arnaud.brunet+eclipse> |
| Component: | UI | Assignee: | Platform-UI-Inbox <Platform-UI-Inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | pwebster |
| Version: | 4.2.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
This code has been changed in 4.3, and now delegates to the workbench for save: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/bundles/org.eclipse.ui.workbench/Eclipse%20UI/org/eclipse/ui/internal/WorkbenchWindow.java#n525 and http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/bundles/org.eclipse.ui.workbench/Eclipse%20UI/org/eclipse/ui/internal/SaveableHelper.java PW Is there any workaround . The 4.3 version is not released yet. And this bug is major for us because we have a centralized class which process the exceptions. No, there's no work around. Kepler is in RC3 right now, and will be released towards the end of June. The fix was backported to 4.2.2+ (branch R4_2_maintenance) but if you want it there you would have to build it yourself: http://wiki.eclipse.org/Platform-releng/Platform_Build PW I guess i have to surround all doSave contents with a try {} catch (Throwable) { process like the ErrorHandler }
Thanks Peter.
*** This bug has been marked as a duplicate of bug 405562 *** |
Hello, The method PartServiceImpl.savePart(MPart, boolean) just logs exception and doesn't invoke the WorkbenchErrorHandler : try { ContextInjectionFactory.invoke(client, Persist.class, part.getContext()); } catch (InjectionException e) { log("Failed to persist contents of part", "Failed to persist contents of part ({0})", //$NON-NLS-1$ //$NON-NLS-2$ part.getElementId(), e); return false; } catch (RuntimeException e) { log("Failed to persist contents of part via DI", //$NON-NLS-1$ "Failed to persist contents of part ({0}) via DI", part.getElementId(), e); //$NON-NLS-1$ return false; } So if an exception is thrown in the EditorPart.doSave(IProgressMonitor) method, the WorkbenchErrorHandler is not aware of the error. And we can not catch the exception in global way. Regards, Arnaud