]> arthur.barton.de Git - netdata.git/commitdiff
error handling for charts index download #269
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Mon, 18 Apr 2016 23:19:35 +0000 (02:19 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Mon, 18 Apr 2016 23:19:35 +0000 (02:19 +0300)
web/dashboard.js
web/index.html

index 5e1dd51c353e39a9f415bc8a915d20eacbd674ff..b6c62ae3c914ffa81bab6583c11c1735281b9420 100644 (file)
                101: { message: "Cannot load jQuery", alert: true },
                402: { message: "Chart library not found", alert: false },
                403: { message: "Chart library not enabled/is failed", alert: false },
-               404: { message: "Chart not found", alert: false }
+               404: { message: "Chart not found", alert: false },
+               405: { message: "Cannot download charts index from server", alert: true },
+               406: { message: "Invalid charts index downloaded from server", alert: true }
        };
        NETDATA.errorLast = {
                code: 0,
                        .done(function(data) {
                                if(data !== null) {
                                        var h = NETDATA.chartRegistry.fixid(host);
-                                       //console.log('downloaded all charts from ' + host + ' (' + h + ')');
                                        self.charts[h] = data.charts;
                                }
+                               else NETDATA.error(406, host + '/api/v1/charts');
+
                                if(typeof callback === 'function')
                                        callback(data);
                        })
                        .fail(function() {
+                               NETDATA.error(405, host + '/api/v1/charts');
+
                                if(typeof callback === 'function')
                                        callback(null);
                        });
index ea955780a0b63b3ccf7b5074a55accd4acf956f4..546196b87d443a59118a424ec9bec910d8f44880 100644 (file)
        </script>
 
        <!-- load the dashboard manager - it will do the rest -->
-       <script type="text/javascript" src="dashboard.js?v31"></script>
+       <script type="text/javascript" src="dashboard.js?v32"></script>
 </head>
 
 <body data-spy="scroll" data-target="#sidebar">