mirror of https://gitee.com/bigwinds/arangodb
remove TRI_ERROR_ARANGO_VIEW_NOT_FOUND, rename TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND to TRI_ERROR_ARNANGO_DATA_SOURCE_NOT_FOUND
This commit is contained in:
parent
0b37cd1796
commit
01d9baf359
|
@ -529,7 +529,7 @@ static void GetDocumentByIdentifier(transaction::Methods* trx,
|
|||
if (!res.ok()) {
|
||||
if (ignoreError) {
|
||||
if (res.errorNumber() == TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND ||
|
||||
res.errorNumber() == TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND ||
|
||||
res.errorNumber() == TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND ||
|
||||
res.errorNumber() == TRI_ERROR_ARANGO_CROSS_COLLECTION_REQUEST) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ IndexNode::IndexNode(ExecutionPlan* plan, arangodb::velocypack::Slice const& bas
|
|||
std::string msg("collection '");
|
||||
msg.append(base.get("collection").copyString());
|
||||
msg.append("' not found");
|
||||
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, msg);
|
||||
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, msg);
|
||||
}
|
||||
|
||||
VPackSlice indexes = base.get("indexes");
|
||||
|
|
|
@ -988,7 +988,7 @@ size_t ClusterComm::performRequests(std::vector<ClusterCommRequest>& requests,
|
|||
VPackSlice payload = res.answer->payload();
|
||||
VPackSlice errorNum = payload.get(StaticStrings::ErrorNum);
|
||||
if (errorNum.isInteger() &&
|
||||
errorNum.getInt() == TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND) {
|
||||
errorNum.getInt() == TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND) {
|
||||
res.status = CL_COMM_BACKEND_UNAVAILABLE;
|
||||
// This is a fake, but it will lead to a retry. If we timeout
|
||||
// here and now, then the customer will get this result.
|
||||
|
|
|
@ -822,7 +822,7 @@ std::shared_ptr<LogicalCollection> ClusterInfo::getCollection(
|
|||
loadPlan();
|
||||
}
|
||||
THROW_ARANGO_EXCEPTION_MESSAGE(
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND,
|
||||
"Collection not found: " + collectionID + " in database " + databaseID);
|
||||
}
|
||||
|
||||
|
@ -1581,7 +1581,7 @@ Result ClusterInfo::setCollectionPropertiesCoordinator(
|
|||
res = ac.getValues("Plan/Collections/" + databaseName + "/" + collectionID);
|
||||
|
||||
if (!res.successful()) {
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
velocypack::Slice collection = res.slice()[0].get(
|
||||
|
@ -1589,7 +1589,7 @@ Result ClusterInfo::setCollectionPropertiesCoordinator(
|
|||
"Collections", databaseName, collectionID}));
|
||||
|
||||
if (!collection.isObject()) {
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
VPackBuilder temp;
|
||||
|
@ -1635,7 +1635,7 @@ Result ClusterInfo::setCollectionStatusCoordinator(
|
|||
res = ac.getValues("Plan/Collections/" + databaseName + "/" + collectionID);
|
||||
|
||||
if (!res.successful()) {
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
VPackSlice col = res.slice()[0].get(
|
||||
|
@ -1643,7 +1643,7 @@ Result ClusterInfo::setCollectionStatusCoordinator(
|
|||
"Collections", databaseName, collectionID}));
|
||||
|
||||
if (!col.isObject()) {
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
TRI_vocbase_col_status_e old = static_cast<TRI_vocbase_col_status_e>(
|
||||
|
@ -1809,7 +1809,7 @@ int ClusterInfo::ensureIndexCoordinatorWithoutRollback(
|
|||
"Collections", databaseName, collectionID}));
|
||||
|
||||
if (!collection.isObject()) {
|
||||
return setErrormsg(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, errorMsg);
|
||||
return setErrormsg(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, errorMsg);
|
||||
}
|
||||
|
||||
loadPlan();
|
||||
|
@ -2116,8 +2116,8 @@ int ClusterInfo::dropIndexCoordinator(std::string const& databaseName,
|
|||
"Collections", databaseName, collectionID}));
|
||||
if (!previous.isObject()) {
|
||||
events::DropIndex(collectionID, idString,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
|
||||
TRI_ASSERT(VPackObjectIterator(previous).size() > 0);
|
||||
|
@ -2750,7 +2750,7 @@ std::shared_ptr<std::vector<ShardID>> ClusterInfo::getShardList(
|
|||
/// values for some of the sharding attributes is silently ignored
|
||||
/// and treated as if these values were `null`. In the second mode
|
||||
/// (`docComplete`==false) leads to an error which is reported by
|
||||
/// returning TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, which is the only
|
||||
/// returning TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, which is the only
|
||||
/// error code that can be returned.
|
||||
///
|
||||
/// In either case, if the collection is found, the variable
|
||||
|
@ -2806,7 +2806,7 @@ int ClusterInfo::getResponsibleShard(LogicalCollection* collInfo,
|
|||
}
|
||||
|
||||
if (!found) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
|
||||
int error = TRI_ERROR_NO_ERROR;
|
||||
|
|
|
@ -320,7 +320,7 @@ static int distributeBabyOnShards(
|
|||
ShardID shardID;
|
||||
int error = ci->getResponsibleShard(collinfo.get(), node, false, shardID,
|
||||
usesDefaultShardingAttributes);
|
||||
if (error == TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND) {
|
||||
if (error == TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND) {
|
||||
return TRI_ERROR_CLUSTER_SHARD_GONE;
|
||||
}
|
||||
if (error != TRI_ERROR_NO_ERROR) {
|
||||
|
@ -397,7 +397,7 @@ static int distributeBabyOnShards(
|
|||
error = ci->getResponsibleShard(collinfo.get(), node, true, shardID,
|
||||
usesDefaultShardingAttributes, _key);
|
||||
}
|
||||
if (error == TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND) {
|
||||
if (error == TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND) {
|
||||
return TRI_ERROR_CLUSTER_SHARD_GONE;
|
||||
}
|
||||
|
||||
|
@ -711,7 +711,7 @@ int revisionOnCoordinator(std::string const& dbname,
|
|||
try {
|
||||
collinfo = ci->getCollection(dbname, collname);
|
||||
} catch (...) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
TRI_ASSERT(collinfo != nullptr);
|
||||
|
||||
|
@ -785,7 +785,7 @@ int warmupOnCoordinator(std::string const& dbname,
|
|||
try {
|
||||
collinfo = ci->getCollection(dbname, cid);
|
||||
} catch (...) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
TRI_ASSERT(collinfo != nullptr);
|
||||
|
||||
|
@ -833,7 +833,7 @@ int figuresOnCoordinator(std::string const& dbname, std::string const& collname,
|
|||
try {
|
||||
collinfo = ci->getCollection(dbname, collname);
|
||||
} catch (...) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
TRI_ASSERT(collinfo != nullptr);
|
||||
|
||||
|
@ -904,7 +904,7 @@ int countOnCoordinator(std::string const& dbname, std::string const& collname,
|
|||
try {
|
||||
collinfo = ci->getCollection(dbname, collname);
|
||||
} catch (...) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
TRI_ASSERT(collinfo != nullptr);
|
||||
|
||||
|
@ -970,7 +970,7 @@ int selectivityEstimatesOnCoordinator(
|
|||
try {
|
||||
collinfo = ci->getCollection(dbname, collname);
|
||||
} catch (...) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
TRI_ASSERT(collinfo != nullptr);
|
||||
|
||||
|
@ -1092,7 +1092,7 @@ int createDocumentOnCoordinator(
|
|||
try {
|
||||
collinfo = ci->getCollection(dbname, collname);
|
||||
} catch (...) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
TRI_ASSERT(collinfo != nullptr);
|
||||
|
||||
|
@ -1233,7 +1233,7 @@ int deleteDocumentOnCoordinator(
|
|||
try {
|
||||
collinfo = ci->getCollection(dbname, collname);
|
||||
} catch (...) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
TRI_ASSERT(collinfo != nullptr);
|
||||
bool useDefaultSharding = collinfo->usesDefaultShardKeys();
|
||||
|
@ -1280,7 +1280,7 @@ int deleteDocumentOnCoordinator(
|
|||
arangodb::basics::VelocyPackHelper::EmptyObjectValue(), true,
|
||||
shardID, usesDefaultShardingAttributes, _key.toString());
|
||||
|
||||
if (error == TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND) {
|
||||
if (error == TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND) {
|
||||
return TRI_ERROR_CLUSTER_SHARD_GONE;
|
||||
}
|
||||
}
|
||||
|
@ -1466,7 +1466,7 @@ int truncateCollectionOnCoordinator(std::string const& dbname,
|
|||
try {
|
||||
collinfo = ci->getCollection(dbname, collname);
|
||||
} catch (...) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
TRI_ASSERT(collinfo != nullptr);
|
||||
|
||||
|
@ -1521,7 +1521,7 @@ int rotateActiveJournalOnAllDBServers(std::string const& dbname,
|
|||
try {
|
||||
collinfo = ci->getCollection(dbname, collname);
|
||||
} catch (...) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
TRI_ASSERT(collinfo != nullptr);
|
||||
|
||||
|
@ -1589,7 +1589,7 @@ int getDocumentOnCoordinator(
|
|||
try {
|
||||
collinfo = ci->getCollection(dbname, collname);
|
||||
} catch (...) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
TRI_ASSERT(collinfo != nullptr);
|
||||
|
||||
|
|
|
@ -284,7 +284,7 @@ bool IResearchLink::init(arangodb::velocypack::Slice const& definition) {
|
|||
}
|
||||
|
||||
LOG_TOPIC(WARN, iresearch::IResearchFeature::IRESEARCH) << "error finding view for link '" << _id << "'";
|
||||
TRI_set_errno(TRI_ERROR_ARANGO_VIEW_NOT_FOUND);
|
||||
TRI_set_errno(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -488,14 +488,14 @@ Result IResearchLink::remove(
|
|||
|
||||
arangodb::Result IResearchLink::recover() {
|
||||
if (!_collection) {
|
||||
return {TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND}; // current link isn't associated with the collection
|
||||
return {TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND}; // current link isn't associated with the collection
|
||||
}
|
||||
|
||||
// do not acquire `_mutex` lock here, since it causes deadlock
|
||||
auto* view = _view.get();
|
||||
|
||||
if (!view) {
|
||||
return {TRI_ERROR_ARANGO_VIEW_NOT_FOUND}; // slice has identifier but the current object does not
|
||||
return {TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND}; // slice has identifier but the current object does not
|
||||
}
|
||||
|
||||
arangodb::velocypack::Builder link;
|
||||
|
@ -599,4 +599,4 @@ NS_END // arangodb
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
@ -173,7 +173,7 @@ void ensureLink(
|
|||
LOG_TOPIC(TRACE, arangodb::iresearch::IResearchFeature::IRESEARCH)
|
||||
<< "Cannot create index for the collection '" << cid
|
||||
<< "' in the database '" << dbId << "' : "
|
||||
<< TRI_errno_string(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
<< TRI_errno_string(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -582,7 +582,7 @@ arangodb::Result updateLinks(
|
|||
}
|
||||
|
||||
return arangodb::Result(
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND,
|
||||
std::string("failed to get collection while updating iResearch view '") + std::to_string(view.id()) + "' collection '" + collectionName + "'"
|
||||
);
|
||||
}
|
||||
|
@ -1940,7 +1940,7 @@ arangodb::Result IResearchView::updateLogicalProperties(
|
|||
) {
|
||||
return _logicalView
|
||||
? _logicalView->updateProperties(slice, partialUpdate, doSync)
|
||||
: arangodb::Result(TRI_ERROR_ARANGO_VIEW_NOT_FOUND)
|
||||
: arangodb::Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND)
|
||||
;
|
||||
}
|
||||
|
||||
|
@ -2235,4 +2235,4 @@ NS_END // arangodb
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
@ -146,7 +146,7 @@ static arangodb::MMFilesGeoIndex* getGeoIndex(
|
|||
auto document = trx->documentCollection(cid);
|
||||
|
||||
if (document == nullptr) {
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND,
|
||||
"'%s'", collectionName.c_str());
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,7 @@ AqlValue MMFilesAqlFunctions::Fulltext(
|
|||
|
||||
TRI_voc_cid_t cid = trx->resolver()->getCollectionIdLocal(cname);
|
||||
if (cid == 0) {
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, "%s",
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, "%s",
|
||||
cname.c_str());
|
||||
}
|
||||
// add the collection to the query for proper cache handling
|
||||
|
|
|
@ -807,7 +807,7 @@ int MMFilesCollection::reserveJournalSpace(TRI_voc_tick_t tick,
|
|||
while (true) {
|
||||
// no need to go on if the collection is already deleted
|
||||
if (_logicalCollection->status() == TRI_VOC_COL_STATUS_DELETED) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
|
||||
MMFilesDatafile* datafile = nullptr;
|
||||
|
|
|
@ -500,7 +500,7 @@ int MMFilesCollectorThread::processQueuedOperations(bool& worked) {
|
|||
if (res == TRI_ERROR_NO_ERROR) {
|
||||
LOG_TOPIC(TRACE, Logger::COLLECTOR) << "queued operations applied successfully";
|
||||
} else if (res == TRI_ERROR_ARANGO_DATABASE_NOT_FOUND ||
|
||||
res == TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND) {
|
||||
res == TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND) {
|
||||
// these are expected errors
|
||||
LOG_TOPIC(TRACE, Logger::COLLECTOR)
|
||||
<< "removing queued operations for already deleted collection";
|
||||
|
@ -944,7 +944,7 @@ int MMFilesCollectorThread::collect(MMFilesWalLogfile* logfile) {
|
|||
|
||||
if (res != TRI_ERROR_NO_ERROR &&
|
||||
res != TRI_ERROR_ARANGO_DATABASE_NOT_FOUND &&
|
||||
res != TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND) {
|
||||
res != TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND) {
|
||||
if (res != TRI_ERROR_ARANGO_FILESYSTEM_FULL) {
|
||||
// other places already log this error, and making the logging
|
||||
// conditional here
|
||||
|
@ -961,7 +961,7 @@ int MMFilesCollectorThread::collect(MMFilesWalLogfile* logfile) {
|
|||
}
|
||||
|
||||
// Error conditions TRI_ERROR_ARANGO_DATABASE_NOT_FOUND and
|
||||
// TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND are intentionally ignored
|
||||
// TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND are intentionally ignored
|
||||
// here since this can actually happen if someone has dropped things
|
||||
// in between.
|
||||
|
||||
|
|
|
@ -376,7 +376,7 @@ void MMFilesRestReplicationHandler::handleCommandLoggerFollow() {
|
|||
|
||||
if (c == nullptr) {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -665,7 +665,7 @@ void MMFilesRestReplicationHandler::handleCommandCreateKeys() {
|
|||
|
||||
if (c == nullptr) {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -995,7 +995,7 @@ void MMFilesRestReplicationHandler::handleCommandDump() {
|
|||
|
||||
if (c == nullptr) {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -216,7 +216,7 @@ int MMFilesTransactionCollection::use(int nestingLevel) {
|
|||
_collection = _transaction->vocbase()->lookupCollection(_cid).get();
|
||||
|
||||
if (_collection == nullptr) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -476,7 +476,7 @@ static void JS_WaitCollectorWal(
|
|||
auto col = vocbase->lookupCollection(name);
|
||||
|
||||
if (col == nullptr) {
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
double timeout = 30.0;
|
||||
|
|
|
@ -287,7 +287,7 @@ int MMFilesWalRecoverState::executeSingleOperation(
|
|||
if (res.errorNumber() == TRI_ERROR_ARANGO_CORRUPTED_COLLECTION) {
|
||||
return res.errorNumber();
|
||||
}
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
|
||||
auto mmfiles = static_cast<MMFilesCollection*>(collection->getPhysical());
|
||||
|
@ -543,7 +543,7 @@ bool MMFilesWalRecoverState::ReplayMarker(MMFilesMarker const* marker,
|
|||
|
||||
if (res != TRI_ERROR_NO_ERROR && res != TRI_ERROR_ARANGO_CONFLICT &&
|
||||
res != TRI_ERROR_ARANGO_DATABASE_NOT_FOUND &&
|
||||
res != TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND) {
|
||||
res != TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND) {
|
||||
LOG_TOPIC(WARN, arangodb::Logger::ENGINES)
|
||||
<< "unable to insert document in collection " << collectionId
|
||||
<< " of database " << databaseId << ": " << TRI_errno_string(res);
|
||||
|
@ -625,7 +625,7 @@ bool MMFilesWalRecoverState::ReplayMarker(MMFilesMarker const* marker,
|
|||
|
||||
if (res != TRI_ERROR_NO_ERROR && res != TRI_ERROR_ARANGO_CONFLICT &&
|
||||
res != TRI_ERROR_ARANGO_DATABASE_NOT_FOUND &&
|
||||
res != TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND &&
|
||||
res != TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND &&
|
||||
res != TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND) {
|
||||
LOG_TOPIC(WARN, arangodb::Logger::ENGINES)
|
||||
<< "unable to remove document in collection " << collectionId
|
||||
|
@ -766,7 +766,7 @@ bool MMFilesWalRecoverState::ReplayMarker(MMFilesMarker const* marker,
|
|||
LOG_TOPIC(TRACE, arangodb::Logger::ENGINES)
|
||||
<< "cannot change properties of collection " << collectionId
|
||||
<< " in database " << databaseId << ": "
|
||||
<< TRI_errno_string(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
<< TRI_errno_string(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -826,7 +826,7 @@ bool MMFilesWalRecoverState::ReplayMarker(MMFilesMarker const* marker,
|
|||
// if the underlying collection is gone, we can go on
|
||||
LOG_TOPIC(TRACE, arangodb::Logger::ENGINES)
|
||||
<< "cannot rename view " << viewId << " in database " << databaseId << ": "
|
||||
<< TRI_errno_string(TRI_ERROR_ARANGO_VIEW_NOT_FOUND);
|
||||
<< TRI_errno_string(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -906,7 +906,7 @@ bool MMFilesWalRecoverState::ReplayMarker(MMFilesMarker const* marker,
|
|||
LOG_TOPIC(TRACE, arangodb::Logger::ENGINES)
|
||||
<< "cannot change properties of view " << viewId
|
||||
<< " in database " << databaseId << ": "
|
||||
<< TRI_errno_string(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
<< TRI_errno_string(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -971,7 +971,7 @@ bool MMFilesWalRecoverState::ReplayMarker(MMFilesMarker const* marker,
|
|||
LOG_TOPIC(TRACE, arangodb::Logger::ENGINES)
|
||||
<< "cannot create index for collection " << collectionId
|
||||
<< " in database " << databaseId << ": "
|
||||
<< TRI_errno_string(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
<< TRI_errno_string(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -481,7 +481,7 @@ static void resolveInfo(
|
|||
auto lc = vocbase->lookupCollection(collectionID);
|
||||
|
||||
if (lc == nullptr || lc->deleted()) {
|
||||
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND,
|
||||
collectionID);
|
||||
}
|
||||
|
||||
|
@ -495,7 +495,7 @@ static void resolveInfo(
|
|||
std::shared_ptr<LogicalCollection> lc =
|
||||
ci->getCollection(vocbase->name(), collectionID);
|
||||
if (lc->deleted()) {
|
||||
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND,
|
||||
collectionID);
|
||||
}
|
||||
collectionPlanIdMap.emplace(collectionID, std::to_string(lc->planId()));
|
||||
|
|
|
@ -113,12 +113,12 @@ int Utils::resolveShard(WorkerConfig const* config,
|
|||
if (it != planIDMap.end()) {
|
||||
info = ci->getCollection(config->database(), it->second); // might throw
|
||||
if (info == nullptr) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
} else {
|
||||
LOG_TOPIC(ERR, Logger::PREGEL)
|
||||
<< "The collection could not be translated to a planID";
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
|
||||
TRI_ASSERT(info != nullptr);
|
||||
|
|
|
@ -921,7 +921,7 @@ Result DatabaseInitialSyncer::handleCollection(VPackSlice const& parameters,
|
|||
auto* col = resolveCollection(vocbase(), parameters).get();
|
||||
|
||||
if (col == nullptr) {
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, std::string("cannot dump: ") +
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, std::string("cannot dump: ") +
|
||||
collectionMsg + " not found on slave. Collection info " + parameters.toJson());
|
||||
}
|
||||
|
||||
|
|
|
@ -651,7 +651,7 @@ Result Syncer::dropCollection(VPackSlice const& slice, bool reportError) {
|
|||
|
||||
if (col == nullptr) {
|
||||
if (reportError) {
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
return Result();
|
||||
|
@ -680,7 +680,7 @@ Result Syncer::createIndex(VPackSlice const& slice) {
|
|||
auto col = resolveCollection(vocbase, slice);
|
||||
|
||||
if (col == nullptr) {
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND,
|
||||
"did not find collection for index");
|
||||
}
|
||||
|
||||
|
@ -742,7 +742,7 @@ Result Syncer::dropIndex(arangodb::velocypack::Slice const& slice) {
|
|||
auto* col = resolveCollection(vocbase, slice).get();
|
||||
|
||||
if (col == nullptr) {
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -764,7 +764,7 @@ Result Syncer::dropIndex(arangodb::velocypack::Slice const& slice) {
|
|||
|
||||
Result r = cb(slice);
|
||||
if (r.fail() &&
|
||||
(r.is(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND) ||
|
||||
(r.is(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND) ||
|
||||
r.is(TRI_ERROR_ARANGO_DATABASE_NOT_FOUND))) {
|
||||
// if dropping an index for a non-existing database or collection fails, this is not a real problem
|
||||
return Result();
|
||||
|
|
|
@ -294,7 +294,7 @@ Result TailingSyncer::processDocument(TRI_replication_operation_e type,
|
|||
auto* coll = resolveCollection(vocbase, slice).get();
|
||||
|
||||
if (coll == nullptr) {
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
bool isSystem = coll->isSystem();
|
||||
|
@ -563,18 +563,18 @@ Result TailingSyncer::renameCollection(VPackSlice const& slice) {
|
|||
col = resolveCollection(vocbase, slice).get();
|
||||
|
||||
if (col == nullptr) {
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, "unknown cuid");
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, "unknown cuid");
|
||||
}
|
||||
} else if (collection.hasKey("oldName")) {
|
||||
col =
|
||||
vocbase->lookupCollection(collection.get("oldName").copyString()).get();
|
||||
|
||||
if (col == nullptr) {
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, "unknown old collection name");
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, "unknown old collection name");
|
||||
}
|
||||
} else {
|
||||
TRI_ASSERT(col == nullptr);
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, "unable to identify collection");
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, "unable to identify collection");
|
||||
}
|
||||
if (col->isSystem()) {
|
||||
LOG_TOPIC(WARN, Logger::REPLICATION) << "Renaming system collection " << col->name();
|
||||
|
@ -620,7 +620,7 @@ Result TailingSyncer::changeCollection(VPackSlice const& slice) {
|
|||
return Result();
|
||||
}
|
||||
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
arangodb::CollectionGuard guard(vocbase, col);
|
||||
|
|
|
@ -177,7 +177,7 @@ bool RestDocumentHandler::readDocument() {
|
|||
case 0:
|
||||
case 1:
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND,
|
||||
"expecting GET /_api/document/<document-handle>");
|
||||
return false;
|
||||
case 2:
|
||||
|
|
|
@ -155,7 +155,7 @@ bool RestEdgesHandler::validateCollection(std::string const& name) {
|
|||
|
||||
if (colType == TRI_COL_TYPE_UNKNOWN) {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ void RestExplainHandler::explainQuery() {
|
|||
auto code = rest::ResponseCode::BAD;
|
||||
|
||||
switch (queryResult.code) {
|
||||
case TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND:
|
||||
case TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND:
|
||||
code = rest::ResponseCode::NOT_FOUND;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ RestStatus RestIndexHandler::getIndexes() {
|
|||
LogicalCollection* coll = collection(cName, tmpColl);
|
||||
if (coll == nullptr) {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return RestStatus::DONE;
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ RestStatus RestIndexHandler::getIndexes() {
|
|||
LogicalCollection* coll = collection(cName, tmpColl);
|
||||
if (coll == nullptr) {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return RestStatus::DONE;
|
||||
}
|
||||
|
||||
|
@ -179,7 +179,7 @@ RestStatus RestIndexHandler::createIndex() {
|
|||
std::string cName = _request->value("collection", found);
|
||||
if (!found) {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return RestStatus::DONE;
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ RestStatus RestIndexHandler::createIndex() {
|
|||
LogicalCollection* coll = collection(cName, tmpColl);
|
||||
if (coll == nullptr) {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return RestStatus::DONE;
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,7 @@ RestStatus RestIndexHandler::dropIndex() {
|
|||
LogicalCollection* coll = collection(cName, tmpColl);
|
||||
if (coll == nullptr) {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return RestStatus::DONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1648,7 +1648,7 @@ int RestReplicationHandler::processRestoreIndexesCoordinator(
|
|||
col = ci->getCollection(dbName, name);
|
||||
} catch (...) {
|
||||
errorMsg = "could not find collection '" + name + "'";
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
TRI_ASSERT(col != nullptr);
|
||||
|
||||
|
@ -1947,7 +1947,7 @@ void RestReplicationHandler::handleCommandAddFollower() {
|
|||
|
||||
if (col == nullptr) {
|
||||
generateError(rest::ResponseCode::SERVER_ERROR,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND,
|
||||
"did not find collection");
|
||||
return;
|
||||
}
|
||||
|
@ -2076,7 +2076,7 @@ void RestReplicationHandler::handleCommandRemoveFollower() {
|
|||
|
||||
if (col == nullptr) {
|
||||
generateError(rest::ResponseCode::SERVER_ERROR,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND,
|
||||
"did not find collection");
|
||||
return;
|
||||
}
|
||||
|
@ -2124,7 +2124,7 @@ void RestReplicationHandler::handleCommandHoldReadLockCollection() {
|
|||
|
||||
if (col == nullptr) {
|
||||
generateError(rest::ResponseCode::SERVER_ERROR,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND,
|
||||
"did not find collection");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -161,7 +161,7 @@ void RestViewHandler::modifyView(bool partialUpdate) {
|
|||
std::shared_ptr<LogicalView> view = _vocbase->lookupView(name);
|
||||
if (view == nullptr) {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_VIEW_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -232,9 +232,9 @@ void RestViewHandler::deleteView() {
|
|||
|
||||
if (res == TRI_ERROR_NO_ERROR) {
|
||||
generateOk(rest::ResponseCode::OK, VPackSlice::trueSlice());
|
||||
} else if (res == TRI_ERROR_ARANGO_VIEW_NOT_FOUND) {
|
||||
} else if (res == TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND) {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_VIEW_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
} else {
|
||||
generateError(rest::ResponseCode::SERVER_ERROR, TRI_ERROR_INTERNAL,
|
||||
"problem dropping view");
|
||||
|
@ -302,7 +302,7 @@ void RestViewHandler::getSingleView(std::string const& name) {
|
|||
generateResult(rest::ResponseCode::OK, props.slice());
|
||||
} else {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_VIEW_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -317,6 +317,6 @@ void RestViewHandler::getViewProperties(std::string const& name) {
|
|||
generateResult(rest::ResponseCode::OK, props.slice());
|
||||
} else {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_VIEW_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -428,7 +428,7 @@ void RestVocbaseBaseHandler::generateTransactionError(
|
|||
|
||||
int code = result.errorNumber();
|
||||
switch (code) {
|
||||
case TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND:
|
||||
case TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND:
|
||||
if (collectionName.empty()) {
|
||||
// no collection name specified
|
||||
generateError(rest::ResponseCode::BAD, code,
|
||||
|
|
|
@ -89,7 +89,7 @@ bool RestWalAccessHandler::parseFilter(WalAccess::Filter& filter) {
|
|||
|
||||
if (c == nullptr) {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ AqlValue RocksDBAqlFunctions::Fulltext(
|
|||
|
||||
TRI_voc_cid_t cid = trx->resolver()->getCollectionIdLocal(cname);
|
||||
if (cid == 0) {
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, "%s",
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, "%s",
|
||||
cname.c_str());
|
||||
}
|
||||
// add the collection to the query for proper cache handling
|
||||
|
@ -192,7 +192,7 @@ static arangodb::RocksDBGeoIndex* getGeoIndex(
|
|||
|
||||
auto document = trx->documentCollection(cid);
|
||||
if (document == nullptr) {
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, "'%s'",
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, "'%s'",
|
||||
collectionName.c_str());
|
||||
}
|
||||
|
||||
|
|
|
@ -262,7 +262,7 @@ void RocksDBRestReplicationHandler::handleCommandLoggerFollow() {
|
|||
|
||||
if (c == nullptr) {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -468,7 +468,7 @@ void RocksDBRestReplicationHandler::handleCommandCreateKeys() {
|
|||
int res = ctx->bindCollection(_vocbase, collection);
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
generateError(rest::ResponseCode::NOT_FOUND,
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ int RocksDBTransactionCollection::use(int nestingLevel) {
|
|||
_collection = _transaction->vocbase()->lookupCollection(_cid).get();
|
||||
|
||||
if (_collection == nullptr) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ int RocksDBTransactionCollection::use(int nestingLevel) {
|
|||
if (res == TRI_ERROR_ARANGO_COLLECTION_NOT_LOADED) {
|
||||
return res;
|
||||
}
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
|
||||
doSetup = true;
|
||||
|
|
|
@ -104,11 +104,11 @@ arangodb::Result applyStateRegistrationCallbacks(
|
|||
|
||||
static void throwCollectionNotFound(char const* name) {
|
||||
if (name == nullptr) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
THROW_ARANGO_EXCEPTION_MESSAGE(
|
||||
TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
std::string(TRI_errno_string(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND)) +
|
||||
TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND,
|
||||
std::string(TRI_errno_string(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND)) +
|
||||
": " + name);
|
||||
}
|
||||
|
||||
|
@ -838,7 +838,7 @@ TRI_voc_tid_t transaction::Methods::tid() const {
|
|||
std::string transaction::Methods::name(TRI_voc_cid_t cid) const {
|
||||
auto c = trxCollection(cid);
|
||||
if (c == nullptr) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
return c->collectionName();
|
||||
}
|
||||
|
@ -919,7 +919,7 @@ TRI_voc_cid_t transaction::Methods::addCollectionAtRuntime(
|
|||
auto dataSource = resolver()->getDataSource(cid);
|
||||
|
||||
if (!dataSource) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
auto result = applyStateRegistrationCallbacks(*dataSource, *_state);
|
||||
|
@ -1163,7 +1163,7 @@ OperationResult transaction::Methods::clusterResultInsert(
|
|||
case rest::ResponseCode::BAD:
|
||||
return errorCodeFromClusterResult(resultBody, TRI_ERROR_INTERNAL);
|
||||
case rest::ResponseCode::NOT_FOUND:
|
||||
return errorCodeFromClusterResult(resultBody, TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return errorCodeFromClusterResult(resultBody, TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
case rest::ResponseCode::CONFLICT:
|
||||
return errorCodeFromClusterResult(resultBody, TRI_ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED);
|
||||
default:
|
||||
|
@ -2934,7 +2934,7 @@ Result transaction::Methods::addCollection(TRI_voc_cid_t cid, char const* name,
|
|||
|
||||
return dataSource
|
||||
? applyStateRegistrationCallbacks(*dataSource, *_state)
|
||||
: Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND)
|
||||
: Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND)
|
||||
;
|
||||
}
|
||||
|
||||
|
@ -3117,7 +3117,7 @@ Result transaction::Methods::addCollectionEmbedded(TRI_voc_cid_t cid,
|
|||
res, std::string(TRI_errno_string(res)) + ": " +
|
||||
resolver()->getCollectionNameCluster(cid) + " [" +
|
||||
AccessMode::typeString(type) + "]");
|
||||
} else if (res == TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND) {
|
||||
} else if (res == TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND) {
|
||||
throwCollectionNotFound(name);
|
||||
}
|
||||
THROW_ARANGO_EXCEPTION(res);
|
||||
|
@ -3148,7 +3148,7 @@ Result transaction::Methods::addCollectionToplevel(TRI_voc_cid_t cid,
|
|||
res, std::string(TRI_errno_string(res)) + ": " +
|
||||
resolver()->getCollectionNameCluster(cid) + " [" +
|
||||
AccessMode::typeString(type) + "]");
|
||||
} else if (res == TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND) {
|
||||
} else if (res == TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND) {
|
||||
throwCollectionNotFound(name);
|
||||
}
|
||||
THROW_ARANGO_EXCEPTION(res);
|
||||
|
@ -3200,7 +3200,7 @@ Result transaction::Methods::resolveId(char const* handle, size_t length,
|
|||
}
|
||||
|
||||
if (cid == 0) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
|
||||
key = p + 1;
|
||||
|
|
|
@ -56,7 +56,7 @@ class CollectionGuard {
|
|||
_collection = _vocbase->useCollection(id, _originalStatus);
|
||||
|
||||
if (_collection == nullptr) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ class CollectionGuard {
|
|||
}
|
||||
|
||||
if (_collection == nullptr) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ class CollectionGuard {
|
|||
}
|
||||
|
||||
if (_collection == nullptr) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ class CollectionGuard {
|
|||
_restoreOriginalStatus(false) {
|
||||
int res = _vocbase->useCollection(collection, _originalStatus);
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -197,14 +197,14 @@ static int ParseDocumentOrDocumentHandle(v8::Isolate* isolate,
|
|||
auto colCopy = col->clone();
|
||||
collection = colCopy.release();
|
||||
} catch (...) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
} else {
|
||||
collection = resolver->getCollectionStruct(collectionName);
|
||||
}
|
||||
if (collection == nullptr) {
|
||||
// collection not found
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
TRI_ASSERT(collection != nullptr);
|
||||
|
@ -1044,7 +1044,7 @@ static void JS_SetTheLeader(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
std::string collectionName = v8Collection->name();
|
||||
auto collection = vocbase->lookupCollection(collectionName);
|
||||
if (collection == nullptr) {
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
std::string theLeader;
|
||||
if (args.Length() >= 1 && args[0]->IsString()) {
|
||||
|
@ -1099,7 +1099,7 @@ static void JS_GetLeader(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
|
||||
auto realCollection = vocbase->lookupCollection(collectionName);
|
||||
if (realCollection == nullptr) {
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
theLeader = realCollection->followers()->getLeader();
|
||||
}
|
||||
|
@ -1148,7 +1148,7 @@ static void JS_AddFollower(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
std::string collectionName = v8Collection->name();
|
||||
auto collection = vocbase->lookupCollection(collectionName);
|
||||
if (collection == nullptr) {
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
collection->followers()->add(serverId);
|
||||
}
|
||||
|
@ -1196,7 +1196,7 @@ static void JS_RemoveFollower(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
std::string collectionName = v8Collection->name();
|
||||
auto collection = vocbase->lookupCollection(collectionName);
|
||||
if (collection == nullptr) {
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
collection->followers()->remove(serverId);
|
||||
}
|
||||
|
@ -1236,7 +1236,7 @@ static void JS_GetFollowers(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
std::string collectionName = v8Collection->name();
|
||||
auto collection = vocbase->lookupCollection(collectionName);
|
||||
if (collection == nullptr) {
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
std::unique_ptr<arangodb::FollowerInfo> const& followerInfo = collection->followers();
|
||||
std::shared_ptr<std::vector<ServerID> const> followers = followerInfo->get();
|
||||
|
@ -1299,7 +1299,7 @@ static void JS_NameVocbaseCol(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
std::string const collectionName(collection->name());
|
||||
|
||||
if (collectionName.empty()) {
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
v8::Handle<v8::Value> result = TRI_V8_STD_STRING(isolate, collectionName);
|
||||
TRI_V8_RETURN(result);
|
||||
|
@ -1950,17 +1950,17 @@ static void JS_PregelStart(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
"Cannot use pregel on system collection");
|
||||
}
|
||||
if (coll->status() == TRI_VOC_COL_STATUS_DELETED || coll->deleted()) {
|
||||
TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, name);
|
||||
TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, name);
|
||||
}
|
||||
} catch (...) {
|
||||
TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, name);
|
||||
TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, name);
|
||||
}
|
||||
} else if (ss->getRole() == ServerState::ROLE_SINGLE) {
|
||||
auto coll = vocbase->lookupCollection(name);
|
||||
|
||||
if (coll == nullptr || coll->status() == TRI_VOC_COL_STATUS_DELETED
|
||||
|| coll->deleted()) {
|
||||
TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, name);
|
||||
TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, name);
|
||||
}
|
||||
} else {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_INTERNAL);
|
||||
|
@ -1987,19 +1987,19 @@ static void JS_PregelStart(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
}
|
||||
}
|
||||
if (coll->status() == TRI_VOC_COL_STATUS_DELETED || coll->deleted()) {
|
||||
TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, name);
|
||||
TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, name);
|
||||
}
|
||||
// smart edge collections contain multiple actual collections
|
||||
std::vector<std::string> actual = coll->realNamesForRead();
|
||||
edgeColls.insert(edgeColls.end(), actual.begin(), actual.end());
|
||||
} catch (...) {
|
||||
TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, name);
|
||||
TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, name);
|
||||
}
|
||||
} else if (ss->getRole() == ServerState::ROLE_SINGLE) {
|
||||
auto coll = vocbase->lookupCollection(name);
|
||||
|
||||
if (coll == nullptr || coll->deleted()) {
|
||||
TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, name);
|
||||
TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, name);
|
||||
}
|
||||
std::vector<std::string> actual = coll->realNamesForRead();
|
||||
edgeColls.insert(edgeColls.end(), actual.begin(), actual.end());
|
||||
|
|
|
@ -232,7 +232,7 @@ static void JS_DropViewVocbase(
|
|||
|
||||
int res = vocbase->dropView(name);
|
||||
|
||||
if (res != TRI_ERROR_NO_ERROR && res != TRI_ERROR_ARANGO_VIEW_NOT_FOUND) {
|
||||
if (res != TRI_ERROR_NO_ERROR && res != TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND) {
|
||||
TRI_V8_THROW_EXCEPTION(res);
|
||||
}
|
||||
|
||||
|
@ -371,7 +371,7 @@ static void JS_NameViewVocbase(
|
|||
std::string const name(view->name());
|
||||
|
||||
if (name.empty()) {
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_VIEW_NOT_FOUND);
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
v8::Handle<v8::Value> result = TRI_V8_STD_STRING(isolate, name);
|
||||
|
@ -549,4 +549,4 @@ void TRI_InitV8Views(v8::Handle<v8::Context> context, TRI_vocbase_t* vocbase,
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
@ -677,7 +677,7 @@ Result LogicalCollection::rename(std::string&& newName, bool doSync) {
|
|||
case TRI_VOC_COL_STATUS_CORRUPTED:
|
||||
return TRI_ERROR_ARANGO_CORRUPTED_COLLECTION;
|
||||
case TRI_VOC_COL_STATUS_DELETED:
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
default:
|
||||
// Fall through intentional
|
||||
break;
|
||||
|
|
|
@ -86,7 +86,7 @@ Result methods::Collections::lookup(TRI_vocbase_t* vocbase,
|
|||
std::string const& name,
|
||||
FuncCallback func) {
|
||||
if (name.empty()) {
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
ExecContext const* exec = ExecContext::CURRENT;
|
||||
|
@ -107,7 +107,7 @@ Result methods::Collections::lookup(TRI_vocbase_t* vocbase,
|
|||
} catch (...) {
|
||||
return Result(TRI_ERROR_INTERNAL);
|
||||
}
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
auto coll = vocbase->lookupCollection(name);
|
||||
|
@ -129,7 +129,7 @@ Result methods::Collections::lookup(TRI_vocbase_t* vocbase,
|
|||
}
|
||||
return Result();
|
||||
}
|
||||
return Result(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return Result(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
Result Collections::create(TRI_vocbase_t* vocbase, std::string const& name,
|
||||
|
|
|
@ -54,7 +54,7 @@ static bool createSystemCollection(TRI_vocbase_t* vocbase,
|
|||
std::string const& name) {
|
||||
Result res = methods::Collections::lookup(vocbase, name,
|
||||
[](LogicalCollection* coll) {});
|
||||
if (res.is(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND)) {
|
||||
if (res.is(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND)) {
|
||||
uint32_t defaultReplFactor = 1;
|
||||
ClusterFeature* cl = ApplicationServer::getFeature<ClusterFeature>("Cluster");
|
||||
if (cl != nullptr) {
|
||||
|
|
|
@ -533,7 +533,7 @@ int TRI_vocbase_t::loadCollection(arangodb::LogicalCollection* collection,
|
|||
}
|
||||
|
||||
if (collection->status() == TRI_VOC_COL_STATUS_DELETED) {
|
||||
return TRI_set_errno(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return TRI_set_errno(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (collection->status() == TRI_VOC_COL_STATUS_CORRUPTED) {
|
||||
|
@ -564,7 +564,7 @@ int TRI_vocbase_t::loadCollection(arangodb::LogicalCollection* collection,
|
|||
|
||||
// someone requested the collection to be dropped, so it's not there
|
||||
// anymore
|
||||
return TRI_set_errno(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return TRI_set_errno(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
// no drop action found, go on
|
||||
|
@ -576,7 +576,7 @@ int TRI_vocbase_t::loadCollection(arangodb::LogicalCollection* collection,
|
|||
|
||||
// deleted, give up
|
||||
if (collection->status() == TRI_VOC_COL_STATUS_DELETED) {
|
||||
return TRI_set_errno(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
return TRI_set_errno(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
// corrupted, give up
|
||||
|
@ -1336,7 +1336,7 @@ int TRI_vocbase_t::renameView(
|
|||
|
||||
if (itr1 == _dataSourceByName.end()
|
||||
|| !std::dynamic_pointer_cast<arangodb::LogicalView>(itr1->second)) {
|
||||
return TRI_ERROR_ARANGO_VIEW_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
|
||||
_dataSourceByName.emplace(newName, view);
|
||||
|
@ -1445,7 +1445,7 @@ int TRI_vocbase_t::renameCollection(
|
|||
|
||||
if (itr1 == _dataSourceByName.end()
|
||||
|| !std::dynamic_pointer_cast<arangodb::LogicalCollection>(itr1->second)) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
|
||||
auto* databaseFeature =
|
||||
|
@ -1537,7 +1537,7 @@ arangodb::LogicalCollection* TRI_vocbase_t::useCollectionByUuid(
|
|||
arangodb::LogicalCollection* TRI_vocbase_t::useCollectionInternal(
|
||||
arangodb::LogicalCollection* collection, TRI_vocbase_col_status_e& status) {
|
||||
if (collection == nullptr) {
|
||||
TRI_set_errno(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
TRI_set_errno(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -1668,7 +1668,7 @@ int TRI_vocbase_t::dropView(std::string const& name) {
|
|||
std::shared_ptr<LogicalView> view = lookupView(name);
|
||||
|
||||
if (view == nullptr) {
|
||||
return TRI_ERROR_ARANGO_VIEW_NOT_FOUND;
|
||||
return TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND;
|
||||
}
|
||||
|
||||
return dropView(view);
|
||||
|
@ -2102,4 +2102,4 @@ TRI_voc_rid_t TRI_StringToRid(char const* p, size_t len, bool& isOld,
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
@ -88,7 +88,7 @@ arangodb::Result convertStatus(rocksdb::Status const& status, StatusHint hint, s
|
|||
case rocksdb::Status::Code::kNotFound:
|
||||
switch (hint) {
|
||||
case StatusHint::collection:
|
||||
return {TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND, std::move(message)};
|
||||
return {TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, std::move(message)};
|
||||
case StatusHint::database:
|
||||
return {TRI_ERROR_ARANGO_DATABASE_NOT_FOUND, std::move(message)};
|
||||
case StatusHint::document:
|
||||
|
@ -96,7 +96,7 @@ arangodb::Result convertStatus(rocksdb::Status const& status, StatusHint hint, s
|
|||
case StatusHint::index:
|
||||
return {TRI_ERROR_ARANGO_INDEX_NOT_FOUND, std::move(message)};
|
||||
case StatusHint::view:
|
||||
return {TRI_ERROR_ARANGO_VIEW_NOT_FOUND, std::move(message)};
|
||||
return {TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, std::move(message)};
|
||||
case StatusHint::wal:
|
||||
// suppress this error if the WAL is queried for changes that are not available
|
||||
return {TRI_ERROR_NO_ERROR};
|
||||
|
|
|
@ -72,7 +72,7 @@ void TRI_InitializeErrorMessages() {
|
|||
REG_ERROR(ERROR_ARANGO_CONFLICT, "conflict");
|
||||
REG_ERROR(ERROR_ARANGO_DATADIR_INVALID, "invalid database directory");
|
||||
REG_ERROR(ERROR_ARANGO_DOCUMENT_NOT_FOUND, "document not found");
|
||||
REG_ERROR(ERROR_ARANGO_COLLECTION_NOT_FOUND, "collection not found");
|
||||
REG_ERROR(ERROR_ARANGO_DATA_SOURCE_NOT_FOUND, "collection or view not found");
|
||||
REG_ERROR(ERROR_ARANGO_COLLECTION_PARAMETER_MISSING, "parameter 'collection' not found");
|
||||
REG_ERROR(ERROR_ARANGO_DOCUMENT_HANDLE_BAD, "illegal document handle");
|
||||
REG_ERROR(ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL, "maximal size of journal too small");
|
||||
|
@ -80,7 +80,6 @@ void TRI_InitializeErrorMessages() {
|
|||
REG_ERROR(ERROR_ARANGO_ILLEGAL_NAME, "illegal name");
|
||||
REG_ERROR(ERROR_ARANGO_NO_INDEX, "no suitable index known");
|
||||
REG_ERROR(ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED, "unique constraint violated");
|
||||
REG_ERROR(ERROR_ARANGO_VIEW_NOT_FOUND, "view not found");
|
||||
REG_ERROR(ERROR_ARANGO_INDEX_NOT_FOUND, "index not found");
|
||||
REG_ERROR(ERROR_ARANGO_CROSS_COLLECTION_REQUEST, "cross collection request not allowed");
|
||||
REG_ERROR(ERROR_ARANGO_INDEX_HANDLE_BAD, "illegal index handle");
|
||||
|
|
|
@ -348,7 +348,7 @@ constexpr int TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND
|
|||
/// "collection not found"
|
||||
/// Will be raised when a collection with the given identifier or name is
|
||||
/// unknown.
|
||||
constexpr int TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND = 1203;
|
||||
constexpr int TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND = 1203;
|
||||
|
||||
/// 1204: ERROR_ARANGO_COLLECTION_PARAMETER_MISSING
|
||||
/// "parameter 'collection' not found"
|
||||
|
@ -385,11 +385,6 @@ constexpr int TRI_ERROR_ARANGO_NO_INDEX
|
|||
/// Will be raised when there is a unique constraint violation.
|
||||
constexpr int TRI_ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED = 1210;
|
||||
|
||||
/// 1211: ERROR_ARANGO_VIEW_NOT_FOUND
|
||||
/// "view not found"
|
||||
/// Will be raised when a view with the given identifier or name is unknown.
|
||||
constexpr int TRI_ERROR_ARANGO_VIEW_NOT_FOUND = 1211;
|
||||
|
||||
/// 1212: ERROR_ARANGO_INDEX_NOT_FOUND
|
||||
/// "index not found"
|
||||
/// Will be raised when an index with a given identifier is unknown.
|
||||
|
@ -532,12 +527,6 @@ constexpr int TRI_ERROR_ARANGO_COLLECTION_NOT_LOADED
|
|||
/// needed.
|
||||
constexpr int TRI_ERROR_ARANGO_DOCUMENT_REV_BAD = 1239;
|
||||
|
||||
/// 1240: ERROR_ARANGO_DATA_SOURCE_NOT_FOUND
|
||||
/// "data source not found"
|
||||
/// Will be raised when a data source (view or collection) with the given
|
||||
/// identifier or name is unknown.
|
||||
constexpr int TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND = 1240;
|
||||
|
||||
/// 1300: ERROR_ARANGO_DATAFILE_FULL
|
||||
/// "datafile full"
|
||||
/// Will be raised when the datafile reaches its limit.
|
||||
|
|
|
@ -366,8 +366,7 @@ rest::ResponseCode GeneralResponse::responseCode(int code) {
|
|||
return ResponseCode::FORBIDDEN;
|
||||
|
||||
case TRI_ERROR_ARANGO_DATABASE_NOT_FOUND:
|
||||
case TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND:
|
||||
case TRI_ERROR_ARANGO_VIEW_NOT_FOUND:
|
||||
case TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND:
|
||||
case TRI_ERROR_ARANGO_COLLECTION_NOT_LOADED:
|
||||
case TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND:
|
||||
case TRI_ERROR_ARANGO_ENDPOINT_NOT_FOUND:
|
||||
|
|
Loading…
Reference in New Issue