From fab8ba533fa6378da5eb04ec066934d7ec9f7a2a Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Fri, 26 Jul 2013 15:14:34 +0200 Subject: [PATCH] The Foxx will now throw an error whenever a repository is created but no collection with the given name exists --- js/server/modules/org/arangodb/foxx.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/server/modules/org/arangodb/foxx.js b/js/server/modules/org/arangodb/foxx.js index 682bee51b2..ee4d5c4d8f 100644 --- a/js/server/modules/org/arangodb/foxx.js +++ b/js/server/modules/org/arangodb/foxx.js @@ -187,9 +187,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); },