mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-07 02:15:24 +00:00
Fix fetchAgents error handling
This commit is contained in:
parent
0eba7b645d
commit
cac38d12ac
@ -276,11 +276,19 @@ app.controller('settingsController', function ($scope, $rootScope, $http, $route
|
||||
$scope.currentDefault = JSON.parse(appState.getCurrentAPI()).id;
|
||||
}
|
||||
|
||||
await Promise.all([
|
||||
genericReq.request('GET', '/api/wazuh-api/fetchAgents'),
|
||||
getSettings()
|
||||
]);
|
||||
try {
|
||||
await genericReq.request('GET', '/api/wazuh-api/fetchAgents');
|
||||
} catch (error) {
|
||||
|
||||
if(error && error.status && error.status === -1) {
|
||||
errorHandler.handle('Wazuh API was inserted correctly, but something happened while fetching agents data.','Fetch agents',true);
|
||||
} else {
|
||||
errorHandler.handle(error,'Fetch agents');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
await getSettings();
|
||||
|
||||
if(!$scope.$$phase) $scope.$digest();
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user