Permalink
Browse files

COUCH-1470 - added error handling for opening missing document in futon.

Also made all js alert error messages have the same format.
  • Loading branch information...
1 parent 8979e5e commit 5da40eef7e8b33a99de957085ddf1c3b09062935 @asbaker asbaker committed with janl May 11, 2012
Showing with 9 additions and 5 deletions.
  1. +1 −0 THANKS
  2. +8 −5 share/www/script/futon.browse.js
View
1 THANKS
@@ -97,6 +97,7 @@ suggesting improvements or submitting changes. Some of these people are:
* Alexander Dorofeev <aka.spin@gmail.com>
* Anthony S Baker <anthony.s.baker@gmail.com>
* Ewan McDougall <info@mrloop.com>
+ * Anthony S Baker <anthony.s.baker@gmail.com>
For a list of authors see the `AUTHORS` file.
@@ -570,15 +570,15 @@
"/" + $.couch.encodeDocId(doc._id) +
"/_view/" + encodeURIComponent(data.name);
},
- error: function(status, e, reason) {
- alert(reason);
+ error: function(status, error, reason) {
+ alert("Error: " + error + "\n\n" + reason);
}
});
}
db.openDoc(docId, {
error: function(status, error, reason) {
if (status == 404) save(null);
- else alert(reason);
+ else alert("Error: " + error + "\n\n" + reason);
},
success: function(doc) {
save(doc);
@@ -616,8 +616,8 @@
$("#viewcode button.revert, #viewcode button.save")
.attr("disabled", "disabled");
},
- error: function(status, e, reason) {
- alert(reason);
+ error: function(status, error, reason) {
+ alert("Error: " + error + "\n\n" + reason);
}
});
}
@@ -1009,6 +1009,9 @@
if (!page.isNew) {
db.openDoc(docId, {revs_info: true,
+ error: function(status, error, reason) {
+ alert("Error: " + error + "\n\n" + reason);
+ },
success: function(doc) {
var revs = doc._revs_info || [];
delete doc._revs_info;

0 comments on commit 5da40ee

Please sign in to comment.