Commit b9c8df56 authored by Mikaël Salson's avatar Mikaël Salson Committed by Vidjil

browser/js/database.js: Querying CloneDB: get error messages

Error messages can be returned by the controller. We must properly display them.
This behaviour should probably be shared by all the cases.
parent 8ad32274
Pipeline #35187 passed with stages
in 6 minutes and 51 seconds
......@@ -313,12 +313,26 @@ Database.prototype = {
data: "sequences="+windows.join()+"&sample_set_id="+self.m.sample_set_id,
xhrFields: {withCredentials: true},
success: function (result) {
try {
res = jQuery.parseJSON(result);
result = res;
} catch (err) {}
self.connected = true;
for (var i = 0; i < kept_clones.length; i++) {
self.m.clones[kept_clones[i]].seg.clonedb = processCloneDBContents(result[i]);
}
m.shouldRefresh()
m.update()
if (typeof result.success !== 'undefined' && result.success == 'false') {
console.log({
"type": "flash",
"msg": result.message,
"priority": 2
});
self.connected = false;
} else {
for (var i = 0; i < kept_clones.length; i++) {
self.m.clones[kept_clones[i]].seg.clonedb = processCloneDBContents(result[i]);
}
m.shouldRefresh()
m.update()
}
},
error: function() {
self.connected = false;
......
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