Problem with the error handler on update error #20

nicogranelli opened this Issue Oct 14, 2011 · 6 comments


None yet

3 participants


I'm using this project for the first time. This are the steps to reproduce the error:

  1. fetch a model
  2. change the model in futon (to trigger an error for conflict)
  3. save the model
  4. the error callback is called, but with wrong arguments. I used a console.log(arguments) inside the callback, and I get these 3:
  • The model
  • undefined
  • and Object with success and error, both functions

According to, the error callback should get the model and the response.

NOTE: Maybe this is because couchdb, and response can't be returned, I'm not sure, I don't know this project or couchdb well enough to be sure.


PD: Do you need an unit test showing the error? I can try to write a jasmine showing it


That would be handy!


I'm having the same problem. How do I get access to the actual error that was thrown during a save() ?


Digging into it right now


Unfortunately there's no way to access the response itself since jquery.couch.js does not pass it to the error-callback. But I added a new object that will be passed to error-callbacks that accumulates at least some information on the request.

A simple example for an error callback for a non-existing model:

myModel.fetch({error: function(model, req, options){
    console.log(model, req, options);

This would lead to the following console output:


Is this sufficient enough?


sorry for the late response, I always miss github notifications.

Backbone return the response so the user could check the error, so returning the error instead is pretty close.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment