Make 'getNodeFat' throw an exception if a node that's not in the map is requested.

Log the context when this exception is thrown.
This commit is contained in:
JoelKatz
2012-12-24 19:08:57 -08:00
parent 7ffb9201c5
commit 2897bd00c2
2 changed files with 36 additions and 16 deletions

View File

@@ -99,8 +99,8 @@ bool SHAMap::getNodeFat(const SHAMapNode& wanted, std::vector<SHAMapNode>& nodeI
SHAMapTreeNode::pointer node = getNode(wanted);
if (!node)
{
cLog(lsWARNING) << "peer requested node we don't have: " << wanted;
return false;
cLog(lsWARNING) << "peer requested node that not in the map: " << wanted;
throw std::runtime_error("Peer requested node not in map");
}
nodeIDs.push_back(*node);