Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Summary from IAdvisorInfoCollector#createExceptionInfo

I'm using IAdvisorInfoCollector#createExceptionInfo to handle exceptions in a work item save precondition plug-in as follows:

public void run( AdvisableOperation operation,

IProcessConfigurationElement advisorConfiguration,
IAdvisorInfoCollector collector, IProgressMonitor monitor )
throws TeamRepositoryException
{
try
{
...
}
catch (Throwable t)
{
IAdvisorInfo info = collector.createExceptionInfo(
"The XXXX WorkItemSave operation advisor "
+ "encountered an unexpected exeception", t );
collector.addInfo( info );
}
}


When an exception is thrown and caught in my plug-in, the work item save fails as intended. However, the message displayed to the user doesn't contain the summary string I specified in IAdvisorInfoCollector#createExceptionInfo call. Rather, the message displayed is

'Save Work Item' failed. Preconditions have not been met: Error: exception message.


How can I have the IAdvisorInfoCollector#createExceptionInfo summary string included in the user message?

Thanks,
Geoff Alexander

0 votes



4 answers

Permanent link
On Thu, 22 Jul 2010 17:53:00 +0000, gdlxn wrote:
How can I have the IAdvisorInfoCollector#createExceptionInfo summary
string included in the user message?

The output you're reporting based on that code doesn't look right. You
should be seeing the summary as you expect.

I would suggest debugging this by placing two breakpoints:
1. In AdvisorInfoCollector#createExceptionInfo(...)
Double-check that the summary you expect to be passing in is getting
passed.
2. In TeamAdvisorViewLabelProvider#getBaseText(...), inside the
instanceof IReportInfo block.
Here you should be able to see how the text is being retrieved for the
report info.

- Jared
------------------------
Jazz Team process

0 votes


Permanent link
My summary is getting passed to AdvisorInfoCollector#createExceptionInfo(...). In setting a breakpoint on the first line of TeamAdvisorViewLabelProvider#getBaseText(...), I find that it's not being called.

What I did find is that the following code segment from OperationAdviseManager#advise(...) does not include the summary in the message string:
String message;

IReportInfo firstError = findFirstError(operationReport);
if (firstError == null || firstError.getIdentifier().equals(IParticipantInfoCollector.ID_EXCEPTION_PROBLEM) || firstError.getIdentifier().equals(ID_OPERATION_EXCEPTION)) {
message = NLS.bind(Messages.getCommonString("OperationAdviceManager.11"), name); //$NON-NLS-1$
} else if (firstError.getIdentifier().equals(ID_PERMISSION_DENIED_PROBLEM)) {
message = NLS.bind(Messages.getCommonString("OperationAdviceManager.12"), name); //$NON-NLS-1$
if (operation.shouldThrowPermissionDeniedException()) {
PermissionDeniedException permissionDenied = new PermissionDeniedException(message);
permissionDenied.setProcessReportData(operationReport);
throw permissionDenied;
}
} else if (firstError instanceof IAdvisorInfo) {
message = NLS.bind(Messages.getCommonString("OperationAdviceManager.13"), name, firstError.getDescription()); //$NON-NLS-1$
} else {
message = NLS.bind(Messages.getCommonString("OperationAdviceManager.14"), name, firstError.getDescription()); //$NON-NLS-1$
}
throw new TeamOperationCanceledException(operationReport, message);

So, for example, on a NullPointerException message is set "'Save Work Item' failed. Preconditions have not been met: Error: null.".

Also, IAdvisorInfo#createExceptionInfo(...) only includes the exception's message in the IAdvisorInfo's description, which for example in the case of a NullPointerException is simply "null". It would be useful to include the exception's class name in the description as well.

0 votes


Permanent link
On Tue, 10 Aug 2010 15:23:01 +0000, gdlxn wrote:

My summary is getting passed to
AdvisorInfoCollector#createExceptionInfo(...). In setting a breakpoint
on the first line of
TeamAdvisorViewLabelProvider#getBaseText(...), I find that it's not
being called.

What I did find is that the following code segment from
OperationAdviseManager#advise(...) does not include the summary in the
message string:

Also, IAdvisorInfo#createExceptionInfo(...) only includes the
exception's message in the IAdvisorInfo's description, which for example
in the case of a NullPointerException is simply "null". It would be
useful to include the exception's class name in the description as well.

Thank you for tracking this down. Can you please file a workitem with
these details?

Thanks,
- Jared
-------------------------
Jazz Team Process

0 votes


Permanent link

Thank you for tracking this down. Can you please file a workitem with
these details?


I've opended Defect 129976 (http://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=129976).

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,941

Question asked: Jul 22 '10, 1:46 p.m.

Question was seen: 7,055 times

Last updated: Jul 22 '10, 1:46 p.m.

Confirmation Cancel Confirm