@Override
public void executionError(Location location, Throwable error)
{
if (error instanceof RequestExecutionException)
{
RuntimeErrorType runtime = ErrorHelper.getRuntimeInstance(mErrors);
RequestExecutionException exc = (RequestExecutionException)error;
RequestStatus status = null;
try
{
status = exc.getRequestResource().getRequestStatus();
}
catch (Exception e)
{
// an error occurred whilst getting the request status
LOG.error("Error retrieving the request status", e);
return;
}
// add general errors
if (status.getError() != null)
{
ErrorType errorType = ErrorHelper.createError(status.getError());
runtime.getError().add(errorType);
}
Iterator<?> iterator = status.getActivities();
while (iterator.hasNext())
{
Entry<ActivityInstanceName, ActivityProcessingStatus> entry =
(Entry<ActivityInstanceName, ActivityProcessingStatus>) iterator.next();
if (entry.getValue().getStatus() == ActivityStatus.ERROR)
{
ProcessingElementErrorType pe =
mObjectFactory.createProcessingElementErrorType();
// TODO activity name needs to be mapped to processing element
Activity activity = mActivities.get(entry.getKey());
if (activity != null)
{
pe.setType(activity.getActivityName().toString());
}
else
{
// if the activity instance can't be mapped then it was
// inserted automatically by OGSA-DAI
// only Tee is inserted automatically at the moment
pe.setType(UNKNOWN);
}
Throwable exception = entry.getValue().getError();
ErrorType errorType = ErrorHelper.createError(exception);
pe.getError().add(errorType);
runtime.getProcessingElement().add(pe);
}
}
}
else
{