Commit 34875bba authored by Tristan Cavelier's avatar Tristan Cavelier

davstorage: Wrong error message given when attachment is missing - fixed

parent 3e39ba25
...@@ -590,7 +590,7 @@ ...@@ -590,7 +590,7 @@
error_message: "DavStorage, unable to get attachment.", error_message: "DavStorage, unable to get attachment.",
percentage: [0, 30], percentage: [0, 30],
notify_message: "Getting metedata", notify_message: "Getting metedata",
"Not Found": "missing document", "404": "missing document", // Not Found
notifyProgress: function (e) { notifyProgress: function (e) {
command.notify({ command.notify({
"method": "getAttachment", "method": "getAttachment",
...@@ -605,13 +605,13 @@ ...@@ -605,13 +605,13 @@
getAttachment: function (e) { getAttachment: function (e) {
var attachment = e.target.response._attachments && var attachment = e.target.response._attachments &&
e.target.response._attachments[param._attachment]; e.target.response._attachments[param._attachment];
delete o["404"];
if (typeof attachment !== 'object' || attachment === null) { if (typeof attachment !== 'object' || attachment === null) {
throw {"target": { throw {"target": {
"status": 404, "status": 404,
"statusText": "missing attachment" "statusText": "missing attachment"
}}; }};
} }
delete o["Not Found"];
o.type = attachment.content_type || "application/octet-stream"; o.type = attachment.content_type || "application/octet-stream";
o.notify_message = "Retrieving attachment"; o.notify_message = "Retrieving attachment";
o.percentage = [30, 100]; o.percentage = [30, 100];
...@@ -627,7 +627,7 @@ ...@@ -627,7 +627,7 @@
reject: function (e) { reject: function (e) {
command.reject( command.reject(
e.target.status, e.target.status,
o[e.target.statusText] || e.target.statusText, o[e.target.status] || e.target.statusText,
o.error_message o.error_message
); );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment