diff --git a/js/server/modules/org/arangodb/foxx.js b/js/server/modules/org/arangodb/foxx.js index 7db30eb905..e36795df62 100644 --- a/js/server/modules/org/arangodb/foxx.js +++ b/js/server/modules/org/arangodb/foxx.js @@ -189,9 +189,11 @@ _.extend(Application.prototype, { } else { cname = prefix + "_" + name; } - var collection = db._collection(cname); - + if (!collection) { + throw new Error("collection with name '" + cname + "' does not exist."); + } + return new Repo(prefix, collection, model); },