Permalink
Browse files

refixed the attach document

  • Loading branch information...
1 parent 86664b3 commit 314e2629cac728928d12368d16bf208c79098a42 Martin Murphy committed Oct 22, 2009
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/couchdb/database.js
@@ -291,14 +291,18 @@ Database = {
async: false,
dataType: "json",
success: function(data, textStatus) {
- if (!data.ok) {
+ if (textStatus == 409){
+ status = textStatus;
+ return;
+ }
+ if (!data.ok) {
response = false;
return;
}
doc._rev = data.rev;
},
error: function(xhr) {
- status =xhr.status;
+ throw new Error("Failed to add attachment" + xhr.status);
}
});
}

0 comments on commit 314e262

Please sign in to comment.