1
0
Fork 0

graph viewer now able to throw some errors/notifications

This commit is contained in:
hkernbach 2015-10-30 14:56:39 +01:00 committed by Frank Celler
parent bf0e1d3c8f
commit c88ab6b49c
3 changed files with 41 additions and 10 deletions

View File

@ -1,5 +1,5 @@
/*global $, d3, _, console, document*/ /*global $, d3, _, console, document*/
/*global AbstractAdapter*/ /*global AbstractAdapter, arangoHelper*/
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief Graph functionality /// @brief Graph functionality
/// ///
@ -456,8 +456,15 @@ function GharialAdapter(nodes, edges, viewer, config) {
} }
}, },
error: function(data) { error: function(data) {
var text = "";
try {
text = JSON.parse(data.responseText).errorMessage + ' (' + JSON.parse(data.responseText).errorNum + ')';
arangoHelper.arangoError(data.statusText, text);
}
catch (e) {
throw data.statusText; throw data.statusText;
} }
}
}); });
}; };
@ -476,8 +483,15 @@ function GharialAdapter(nodes, edges, viewer, config) {
} }
}, },
error: function(data) { error: function(data) {
var text = "";
try {
text = JSON.parse(data.responseText).errorMessage + ' (' + JSON.parse(data.responseText).errorNum + ')';
arangoHelper.arangoError(data.statusText, text);
}
catch (e) {
throw data.statusText; throw data.statusText;
} }
}
}); });
}; };
@ -496,8 +510,15 @@ function GharialAdapter(nodes, edges, viewer, config) {
callback(); callback();
}, },
error: function(data) { error: function(data) {
var text = "";
try {
text = JSON.parse(data.responseText).errorMessage + ' (' + JSON.parse(data.responseText).errorNum + ')';
arangoHelper.arangoError(data.statusText, text);
}
catch (e) {
throw data.statusText; throw data.statusText;
} }
}
}); });
}; };
@ -520,8 +541,15 @@ function GharialAdapter(nodes, edges, viewer, config) {
} }
}, },
error: function(data) { error: function(data) {
var text = "";
try {
text = JSON.parse(data.responseText).errorMessage + ' (' + JSON.parse(data.responseText).errorNum + ')';
arangoHelper.arangoError(data.statusText, text);
}
catch (e) {
throw data.statusText; throw data.statusText;
} }
}
}); });
}; };
@ -541,8 +569,15 @@ function GharialAdapter(nodes, edges, viewer, config) {
} }
}, },
error: function(data) { error: function(data) {
var text = "";
try {
text = JSON.parse(data.responseText).errorMessage + ' (' + JSON.parse(data.responseText).errorNum + ')';
arangoHelper.arangoError(data.statusText, text);
}
catch (e) {
throw data.statusText; throw data.statusText;
} }
}
}); });
}; };

View File

@ -56,8 +56,6 @@ var uiComponentsHelper = uiComponentsHelper || {};
$(btn).toggleClass("active", false); $(btn).toggleClass("active", false);
}); });
console.log(button.id);
if (button.id === "control_event_new_node") { if (button.id === "control_event_new_node") {
$('.node').css('cursor', 'pointer'); $('.node').css('cursor', 'pointer');
$('.gv-background').css('cursor', 'copy'); $('.gv-background').css('cursor', 'copy');

View File

@ -188,8 +188,6 @@
var self = this; var self = this;
console.log(this.model.get("path"));
$(this.el).html(this.template.render({ $(this.el).html(this.template.render({
app: this.model, app: this.model,
db: arangoHelper.currentDatabase(), db: arangoHelper.currentDatabase(),