mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-06 18:05:20 +00:00
Handled two more error cases
This commit is contained in:
parent
928dbef527
commit
09c2c96b5e
@ -32,11 +32,15 @@ require('ui/modules').get('app/wazuh', [])
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
if(error.status && error.status === -1){
|
||||
if(error.data && error.data.message && error.data.message.includes('ENOTFOUND')) {
|
||||
defered.reject({data: 'invalid_url'});
|
||||
} else if(error.data && error.data.message && error.data.message.includes('ECONNREFUSED')) {
|
||||
defered.reject({data: 'invalid_port'});
|
||||
} else if(error.status && error.status === -1){
|
||||
defered.reject({data: 'request_timeout_checkapi'});
|
||||
} else if (error.data && error.data.message && error.data.message === 'wrong_credentials') {
|
||||
defered.reject({data: 'wrong_credentials'});
|
||||
}else if (error.error) {
|
||||
} else if (error.error) {
|
||||
defered.reject(error);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user