mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-06 09:55:18 +00:00
Fix error handling whenever Wazuh API is unreachable
This commit is contained in:
parent
af0f58dc65
commit
9f90aae5ba
@ -48,7 +48,8 @@ const settingsWizard = ($rootScope, $location, $q, $window, testAPI, appState, g
|
||||
let fromElastic = false;
|
||||
if (parseInt(data.data.error) === 2){
|
||||
errorHandler.handle('Wazuh App: Please set up Wazuh API credentials.','Routes',true);
|
||||
} else if(data.data.data && data.data.data.apiIsDown){
|
||||
} else if((data.data && (data.data.apiIsDown || data.data.message === 'socket hang up')) ||
|
||||
(data.data.data && (data.data.data.apiIsDown || data.data.data.message === 'socket hang up'))){
|
||||
$rootScope.apiIsDown = "down";
|
||||
errorHandler.handle('Wazuh RESTful API seems to be down.','Routes');
|
||||
} else {
|
||||
|
@ -118,9 +118,7 @@ class WazuhApi {
|
||||
} catch(error){
|
||||
console.log(error.message || error);
|
||||
if(error.code === 'ECONNREFUSED'){
|
||||
wapi_config.password = '****'
|
||||
wapi_config.apiIsDown = true;
|
||||
return reply({ statusCode: 200, data: wapi_config });
|
||||
return reply({ statusCode: 200, data: {password: '****', apiIsDown: true } });
|
||||
} else {
|
||||
return reply({
|
||||
statusCode: 500,
|
||||
|
Loading…
Reference in New Issue
Block a user