Author: fdmanana
Date: Tue Mar 29 14:33:35 2011
New Revision: 1086598
URL: http://svn.apache.org/viewvc?rev=1086598&view=rev
Log:
Better error messages when a function is missing in a design document
Closes COUCHDB-1109.
Patch by Thomas Vander Stichele, thanks.
Modified:
couchdb/trunk/THANKS
couchdb/trunk/share/server/loop.js
Modified: couchdb/trunk/THANKS
URL:
http://svn.apache.org/viewvc/couchdb/trunk/THANKS?rev=1086598&r1=1086597&r2=1086598&view=diff
==============================================================================
--- couchdb/trunk/THANKS (original)
+++ couchdb/trunk/THANKS Tue Mar 29 14:33:35 2011
@@ -76,5 +76,6 @@ suggesting improvements or submitting ch
* Gabriel Farrell <[email protected]>
* Mike Leddy <[email protected]>
* Wayne Conrad <[email protected]>
+ * Thomas Vander Stichele <[email protected]>
For a list of authors see the `AUTHORS` file.
Modified: couchdb/trunk/share/server/loop.js
URL:
http://svn.apache.org/viewvc/couchdb/trunk/share/server/loop.js?rev=1086598&r1=1086597&r2=1086598&view=diff
==============================================================================
--- couchdb/trunk/share/server/loop.js (original)
+++ couchdb/trunk/share/server/loop.js Tue Mar 29 14:33:35 2011
@@ -92,6 +92,11 @@ var DDoc = (function() {
for (var i=0; i < funPath.length; i++) {
if (i+1 == funPath.length) {
var fun = point[funPath[i]];
+ if (!fun) {
+ throw(["error","not_found",
+ "missing " + funPath[0] + " function " + funPath[i] +
+ " on design doc " + ddocId]);
+ }
if (typeof fun != "function") {
fun = Couch.compileFunction(fun, ddoc);
// cache the compiled fun on the ddoc