mirror of https://gitee.com/bigwinds/arangodb
AQL_NEIGHBORS: make the error checking behaviour similar to the non-cluster version.
This commit is contained in:
parent
8b9a8b80b5
commit
91fccfd7ea
|
@ -412,7 +412,7 @@ function WARN (func, error, data) {
|
|||
/// @brief throw a runtime exception
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function THROW (func, error, data) {
|
||||
function THROW (func, error, data, moreMessage) {
|
||||
'use strict';
|
||||
|
||||
var prefix = "";
|
||||
|
@ -429,6 +429,9 @@ function THROW (func, error, data) {
|
|||
else {
|
||||
err.errorMessage = prefix + error.message;
|
||||
}
|
||||
if (moreMessage !== undefined) {
|
||||
err.errorMessage += "; " + moreMessage;
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
|
@ -7422,6 +7425,15 @@ function AQL_NEIGHBORS (vertexCollection,
|
|||
'use strict';
|
||||
|
||||
vertex = TO_ID(vertex, vertexCollection);
|
||||
var collectionFromVertex = vertex.slice(0, vertexCollection.length);
|
||||
if (collectionFromVertex !== vertexCollection) {
|
||||
THROW("AQL_NEIGBORS",
|
||||
INTERNAL.errors.ERROR_ARANGO_DOCUMENT_KEY_BAD,
|
||||
"",
|
||||
"You specified vertex collection `" + collectionFromVertex +
|
||||
"...` for start vertext from the collection`" + vertexCollection + "`");
|
||||
|
||||
}
|
||||
options = CLONE(options) || {};
|
||||
// Fallback to JS if we are in the cluster
|
||||
// Improve the examples. LocalServer can match String -> _id
|
||||
|
|
Loading…
Reference in New Issue