Commit 7d2c0585 authored by Romain Courteaud's avatar Romain Courteaud

ReplicateStorage: increase conflict error verbosity

parent 6e54a1e3
...@@ -238,7 +238,9 @@ ...@@ -238,7 +238,9 @@
id, options); id, options);
} }
// Already exists on destination // Already exists on destination
throw new jIO.util.jIOError("Conflict on '" + id + "'", throw new jIO.util.jIOError("Conflict on '" + id + "': " +
JSON.stringify(doc) + " !== " +
JSON.stringify(remote_doc),
409); 409);
}); });
} }
...@@ -343,7 +345,9 @@ ...@@ -343,7 +345,9 @@
return; return;
} }
if (conflict_force !== true) { if (conflict_force !== true) {
throw new jIO.util.jIOError("Conflict on '" + id + "'", throw new jIO.util.jIOError("Conflict on '" + id + "': " +
JSON.stringify(doc) + " !== " +
JSON.stringify(remote_doc),
409); 409);
} }
} }
......
...@@ -859,7 +859,8 @@ ...@@ -859,7 +859,8 @@
}) })
.fail(function (error) { .fail(function (error) {
ok(error instanceof jIO.util.jIOError); ok(error instanceof jIO.util.jIOError);
equal(error.message, "Conflict on 'conflict'"); equal(error.message, "Conflict on 'conflict': " +
"{\"title\":\"foo\"} !== {\"title\":\"bar\"}");
equal(error.status_code, 409); equal(error.status_code, 409);
}) })
.then(function () { .then(function () {
...@@ -1383,7 +1384,8 @@ ...@@ -1383,7 +1384,8 @@
}) })
.fail(function (error) { .fail(function (error) {
ok(error instanceof jIO.util.jIOError); ok(error instanceof jIO.util.jIOError);
equal(error.message, "Conflict on '" + id + "'"); equal(error.message, "Conflict on '" + id + "': " +
"{\"title\":\"foo4\"} !== {\"title\":\"foo5\"}");
equal(error.status_code, 409); equal(error.status_code, 409);
}) })
.then(function () { .then(function () {
......
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