Skip to content

Commit

Permalink
517545: org.eclipse.core.runtime.CoreException: Node not found: 'xxx'
Browse files Browse the repository at this point in the history
Skip missing nodes in result and log an information message.

Bug: 517545
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=517545
  • Loading branch information
creckord committed May 31, 2017
1 parent 792fe72 commit 1e097d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.epp.internal.mpc.core.MarketplaceClientCore;
Expand Down Expand Up @@ -347,6 +348,7 @@ public List<INode> getNodes(Collection<? extends INode> nodes, IProgressMonitor
}

List<INode> resultNodes = new ArrayList<INode>(nodes.size());
MultiStatus missingNodes = null;
for (INode inputNode : nodes) {
INode resolvedNode = resolvedNodeMapping.get(inputNode);
if (resolvedNode != null) {
Expand All @@ -358,11 +360,18 @@ public List<INode> getNodes(Collection<? extends INode> nodes, IProgressMonitor
} else {
query = inputNode.getUrl();
}
throw new CoreException(
createErrorStatus(Messages.DefaultMarketplaceService_nodeNotFound, query));
IStatus missingNodeDetailStatus = createStatus(IStatus.INFO,
Messages.DefaultMarketplaceService_nodeNotFound, query);
if (missingNodes == null) {
missingNodes = new MultiStatus(MarketplaceClientCore.BUNDLE_ID, 0,
"Some entries could not be found on the Marketplace", null);
}
missingNodes.add(missingNodeDetailStatus);
}
}

if (missingNodes != null) {
MarketplaceClientCore.getLog().log(missingNodes);
}
return resultNodes;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ public interface IMarketplaceService {
INode getNode(INode node, IProgressMonitor monitor) throws CoreException;

/**
* Get a list of nodes by their ids
* Get a list of nodes by their ids. Only existing nodes are returned. Nodes not found on the server will be
* discarded in the result list.
*
* @param nodes
* the nodes which must all have an {@link INode#getId() id}.
Expand Down

0 comments on commit 1e097d3

Please sign in to comment.