Skip to content

Commit

Permalink
Better error messages when a function is missing in a design document
Browse files Browse the repository at this point in the history
Closes COUCHDB-1109.
Patch by Thomas Vander Stichele, thanks.



git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1086598 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
fdmanana committed Mar 29, 2011
1 parent b9ad249 commit 5fc4dc3
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions THANKS
Original file line number Diff line number Diff line change
@@ -76,5 +76,6 @@ suggesting improvements or submitting changes. Some of these people are:
* 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.
5 changes: 5 additions & 0 deletions share/server/loop.js
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5fc4dc3

Please sign in to comment.