Community
Participate
Working Groups
Build ID: I20070625-1500 Steps To Reproduce: Currently, ErrorDialog will display the 'Details' button when the status is a MultiStatus or the status has exception. But if it is MultiStatus and all its children status don't have any message, 'Details' button will open a list with nothing in it. It would be nice if ErrorDialog can check if the children status have any message. If not, don't display the 'Details' button. More information:
I think that if you have MultiStatus then details should show child statuses messages or exceptions. But if you encounter situation in which MultiStatus has children without any information, then I believe that it is invalid MultiStatus usage and separate bug report should be created.
(In reply to comment #1) I would suggest ErrorDialog not rely on passed parameters to behave gracefully.
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Hmmm, hiding them may actually be hiding a bug, making it harder for a developer to track down the real error in the status creation ("hey, why are there no details?"). It's one of those things that you'd want to work differently in a product than during development. But we can't tell the difference. Generally in Eclipse we don't hide programming errors unless the result is catastrophic. Is this a frequent occurrence?
Pretty often, the top level code creates MultiStatus and passes it to several other processes to try to collect children error status (for example). If no children error status is collected, MultiStatus would only contain the top level error. In this case, to make the 'Details' button not visible, before calling ErrorDialog, our code has to convert MultiStatus to IStatus and then call ErrorDialog, because 'Details' button would be visible without checking if MultiStatus has children or not.
Janice, do you use JFace error dialog or StatusManager?
Created attachment 146167 [details] Fix
Kevin, Janice, could you look at this fix? I'll release it this week if no objections is reported.
I don't think the fix would work if MultiStatus has children status, but children status don't match displayMask. The logic in 'populateList()' and 'shouldShowDetailsButton()' has to be consistent.
Created attachment 146379 [details] Fix v2 I have duplicated populateList logic to be sure that the button is displayed if and only if something will be placed on the list. But unfortunately MultiStatus, if created without children, is always OK, so details will be not displayed, even if later error child statuses are added. This is quite suprising.
(In reply to comment #10) > Created an attachment (id=146379) [details] > Fix v2 > > I have duplicated populateList logic to be sure that the button is displayed if > and only if something will be placed on the list. Looks fine. I did find this a bit curious though, I guess it yields what users would expect: + // Only print the exception message if it is not contained in the + // parent message + if (message == null || message.indexOf(eStatus.getMessage()) == -1) { + result |= listContentExists(eStatus, true); + }
Patch slightly modified (more javadocs) and released on 2009-10-01
verified.