// var netdataNoC3 = true; // do not use C3
// var netdataNoBootstrap = true; // do not load bootstrap
// var netdataDontStart = true; // do not start the thread to process the charts
-// var netdataErrorCallback = function(code,msg) {} // Callback function that will be invoked upon error
+// var netdataErrorCallback = null; // Callback function that will be invoked upon error
//
// You can also set the default netdata server, using the following.
// When this variable is not set, we assume the page is hosted on your
console.log("ERROR " + code + ": " + NETDATA.errorCodes[code].message + ": " + msg);
- if(typeof netdataErrorCallback === 'function') {
- netdataErrorCallback(code,msg);
- }
-
- if(NETDATA.errorCodes[code].alert)
+ var ret = true;
+ if(typeof netdataErrorCallback === 'function') {
+ ret = netdataErrorCallback('system', code, msg);
+ }
+
+ if(ret && NETDATA.errorCodes[code].alert)
alert("ERROR " + code + ": " + NETDATA.errorCodes[code].message + ": " + msg);
};
/* error() - private
* show an error instead of the chart
*/
- var error = function(msg) {
+ var error = function(msg) {
+ var ret = true;
- if(typeof netdataErrorCallback === 'function') {
- netdataErrorCallback("", msg);
- }
+ if(typeof netdataErrorCallback === 'function') {
+ ret = netdataErrorCallback('chart', that.id, msg);
+ }
- that.element.innerHTML = that.id + ': ' + msg;
- that.enabled = false;
- that.current = that.pan;
+ if(ret) {
+ that.element.innerHTML = that.id + ': ' + msg;
+ that.enabled = false;
+ that.current = that.pan;
+ }
};
// GUID - a unique identifier for the chart