Make message handler throw NotIndexed if not overdue

This completes the fix of "not indexed" errors, which was inadvertently omitted in a previous fix.
This commit is contained in:
Fangrui Song 2019-01-21 22:56:45 +08:00
parent 0b200a52c3
commit 9eaeefaf72

View File

@ -274,6 +274,8 @@ MessageHandler::FindOrFail(const std::string &path, ReplyOnce &reply,
}
QueryFile *file = FindFile(path, out_file_id);
if (!file) {
if (!overdue)
throw NotIndexed{path};
reply.Error(ErrorCode::InvalidRequest, "not indexed");
return {nullptr, nullptr};
}