couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1086598 - in /couchdb/trunk: THANKS share/server/loop.js
Date Tue, 29 Mar 2011 14:33:36 GMT
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 <gsf747@gmail.com>
  * Mike Leddy <mike@loop.com.br>
  * Wayne Conrad <wayne@databill.com>
+ * Thomas Vander Stichele <thomas@apestaart.org>
 
 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



Mime
View raw message