janmonschke / backbone-couchdb

A couchdb connector for backbone with support for real time changes.

Home Page:http://janmonschke.com/projects/backbone-couchdb.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Undeclared variable error in error handler

dwt opened this issue · comments

Hi there,

I believe that in line https://github.com/janmonschke/backbone-couchdb/blob/master/backbone-couchdb.js#L192

the error variable should actually be e

At least it fails for me with that error.

:-)

Not sure if thats the whole fix, looking at the other error handlers this might be required:


diff --git a/js/vendor/backbone-couchdb-1.2.js b/js/vendor/backbone-couchdb-1.2.
index 5c23a4d..be89ebe 100644
--- a/js/vendor/backbone-couchdb-1.2.js
+++ b/js/vendor/backbone-couchdb-1.2.js
@@ -168,9 +168,9 @@ backbone-couchdb.js is licensed under the MIT license.
         success: function() {
           return opts.success();
         },
-        error: function(nr, req, e) {
+        error: function(status, error, reason) {
           var res;
-          if (e === "deleted") {
+          if (error === "deleted") {
             opts.success();
             return opts.complete();
           } else {

:-) May I redirect your attention to the line that also renames status and reason? As those are also used in the error handler - but I have no idea if the order of the arguments differs in this error handler to all other error handlers.

Didn't see that ^^

Should be fixed now, what do you say?

On Nov 2, 2012, at 10:48 AM, Martin Häcker notifications@github.com wrote:

:-) May I redirect your attention to the line that also renames status and reason? As those are also used in the error handler - but I have no idea if the order of the arguments differs in this error handler to all other error handlers.


Reply to this email directly or view it on GitHub.

looks good.