Skip to content
Browse files

Bubble up status codes for update and removal errors

  • Loading branch information...
1 parent 9ba2160 commit 4a337ddd926e7d5c5765eddf4f47f3b904cfa482 @jcrosby committed Jan 25, 2009
Showing with 17 additions and 17 deletions.
  1. +9 −9 jquery.cloudkit.js
  2. +8 −8 vendor/taffy-1.6.1-patched.js
View
18 jquery.cloudkit.js
@@ -37,7 +37,7 @@
collectionURIs = data.uris;
options.success();
} else if (response.status >= 400) {
- options.error(data.error);
+ options.error(response.status);
} else {
options.error('unexpected error');
}
@@ -71,7 +71,7 @@
if (response.status == 201) {
options.success();
} else {
- options.error();
+ options.error(response.status);
}
}
});
@@ -97,7 +97,7 @@
if (response.status == 200) {
options.success();
} else {
- options.error();
+ options.error(response.status);
}
}
});
@@ -122,7 +122,7 @@
meta['deleted'] = true;
options.success();
} else {
- options.error();
+ options.error(response.status);
}
}
});
@@ -158,7 +158,7 @@
}
options.success();
} else {
- options.error();
+ options.error(response.status);
}
}
});
@@ -185,13 +185,13 @@
success: function() {
options.success();
},
- error: function() {
- options.error();
+ error: function(status) {
+ options.error(status);
}
});
},
- error: function() {
- options.error();
+ error: function(status) {
+ options.error(status);
}
});
},
View
16 vendor/taffy-1.6.1-patched.js
@@ -186,8 +186,8 @@ var TAFFY = function (obj) {
TOb[updateDex] = T.mergeObj(TOb[updateDex], updateObj);
chain_updates(updateObj, updateIndex, position+1, updateCallback, options);
},
- error: function() {
- options.error();
+ error: function(status) {
+ options.error(status);
}
});
};
@@ -203,8 +203,8 @@ var TAFFY = function (obj) {
TOb[removeIndex[position]] = 'remove';
chain_removals(removeIndex, position+1, removeCallback, options);
},
- error: function() {
- options.error();
+ error: function(status) {
+ options.error(status);
}
});
};
@@ -562,8 +562,8 @@ var TAFFY = function (obj) {
bTIA();
options.success(removeIndex);
},
- error: function() {
- options.error();
+ error: function(status) {
+ options.error(status);
}
});
} ,
@@ -625,8 +625,8 @@ var TAFFY = function (obj) {
success: function() {
options.success(updateIndex);
},
- error: function() {
- options.error();
+ error: function(status) {
+ options.error(status);
}
});
} ,

0 comments on commit 4a337dd

Please sign in to comment.
Something went wrong with that request. Please try again.