Commit 8c389cf1 authored by Tristan Cavelier's avatar Tristan Cavelier

gidstorage returns now the error bad request when a gid is wrong

parent 4f3218ea
...@@ -262,9 +262,9 @@ ...@@ -262,9 +262,9 @@
gid = gidFormat(doc, priv.constraints); gid = gidFormat(doc, priv.constraints);
if (gid === undefined || (doc._id && gid !== doc._id)) { if (gid === undefined || (doc._id && gid !== doc._id)) {
return that.error({ return that.error({
"status": 409, "status": 400,
"statusText": "Conflict", "statusText": "Bad Request",
"error": "conflict", "error": "bad_request",
"message": "Cannot " + method + " document", "message": "Cannot " + method + " document",
"reason": "metadata should respect constraints" "reason": "metadata should respect constraints"
}); });
...@@ -340,9 +340,9 @@ ...@@ -340,9 +340,9 @@
gid_object = gidParse(doc._id, priv.constraints); gid_object = gidParse(doc._id, priv.constraints);
if (gid_object === undefined) { if (gid_object === undefined) {
return that.error({ return that.error({
"status": 409, "status": 400,
"statusText": "Conflict", "statusText": "Bad Request",
"error": "conflict", "error": "bad_request",
"message": "Cannot put attachment", "message": "Cannot put attachment",
"reason": "metadata should respect constraints" "reason": "metadata should respect constraints"
}); });
...@@ -390,9 +390,9 @@ ...@@ -390,9 +390,9 @@
gid_object = gidParse(command.cloneDoc()._id, priv.constraints); gid_object = gidParse(command.cloneDoc()._id, priv.constraints);
if (gid_object === undefined) { if (gid_object === undefined) {
return that.error({ return that.error({
"status": 409, "status": 400,
"statusText": "Conflict", "statusText": "Bad Request",
"error": "conflict", "error": "bad_request",
"message": "Cannot get document", "message": "Cannot get document",
"reason": "metadata should respect constraints" "reason": "metadata should respect constraints"
}); });
...@@ -482,9 +482,9 @@ ...@@ -482,9 +482,9 @@
gid_object = gidParse(doc._id, priv.constraints); gid_object = gidParse(doc._id, priv.constraints);
if (gid_object === undefined) { if (gid_object === undefined) {
return that.error({ return that.error({
"status": 409, "status": 400,
"statusText": "Conflict", "statusText": "Bad Request",
"error": "conflict", "error": "bad_request",
"message": "Cannot remove document", "message": "Cannot remove document",
"reason": "metadata should respect constraints" "reason": "metadata should respect constraints"
}); });
......
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