From 15742972975e6f030a759dae7fbd209fa08118e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20=C3=81ngel=20Gonz=C3=A1lez?= Date: Fri, 18 May 2018 13:47:10 +0200 Subject: [PATCH] Removed console.log statements --- public/controllers/agents.js | 2 +- public/controllers/overview.js | 8 ++++++-- public/kibana-integrations/kibana-discover.js | 3 +-- server/controllers/wazuh-elastic.js | 1 - 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/public/controllers/agents.js b/public/controllers/agents.js index 41abee1b1..68794a020 100644 --- a/public/controllers/agents.js +++ b/public/controllers/agents.js @@ -131,7 +131,7 @@ app.controller('agentsController', function ($timeout, $scope, $location, $rootS .then(() => assignFilters(tab,agent)) } } catch (error){ - console.log(error.message || error) + errorHandler.handle('An error occurred while creating custom filters for visualizations','Agents',true); } } diff --git a/public/controllers/overview.js b/public/controllers/overview.js index 5fc69d40a..fc1824237 100644 --- a/public/controllers/overview.js +++ b/public/controllers/overview.js @@ -154,7 +154,7 @@ app.controller('overviewController', function ($timeout, $scope, $location, $roo .then(() => assignFilters(tab)) } } catch(error) { - console.log(error.message || error) + errorHandler.handle('An error occurred while creating custom filters for visualizations','Overview',true); } } @@ -336,5 +336,9 @@ app.controller('overviewController', function ($timeout, $scope, $location, $roo $scope.wzMonitoringEnabled = true; } }) - .catch(error => {console.log(error.message || error);$scope.wzMonitoringEnabled = true}); + .catch(error => { + $scope.wzMonitoringEnabled = true + errorHandler.handle(error, 'Overview'); + if (!$rootScope.$$phase) $rootScope.$digest(); + }); }); diff --git a/public/kibana-integrations/kibana-discover.js b/public/kibana-integrations/kibana-discover.js index 2609fe40d..7ae8c1d85 100644 --- a/public/kibana-integrations/kibana-discover.js +++ b/public/kibana-integrations/kibana-discover.js @@ -766,14 +766,13 @@ function discoverController( if(!appState || !globalState){ $timeout(100) .then(() => { - console.log('Awaiting app state...') return loadFilters(wzCurrentFilters) }) } else { $state.filters = localChange ? $state.filters : []; queryFilter.addFilters(wzCurrentFilters) - .then(() => console.log('Filters loaded successfully')) + .then(() => { }) .catch(error => console.log(error.message || error)); } } diff --git a/server/controllers/wazuh-elastic.js b/server/controllers/wazuh-elastic.js index 91c7d0b5d..9f5b7b428 100644 --- a/server/controllers/wazuh-elastic.js +++ b/server/controllers/wazuh-elastic.js @@ -171,7 +171,6 @@ export default class WazuhElastic { results = await this.wzWrapper.searchWazuhElementsByIndexWithRequest(req, item.title); } catch (error){ forbidden = true; - console.log(`Some user tried to fetch the index pattern ${item.title} without permissions.`) } if((results && results.hits && results.hits.total >= 1) || (!forbidden && results && results.hits && results.hits.total === 0)