mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-06 18:05:20 +00:00
More in deep Elastic error messages, now in backend
This commit is contained in:
parent
bfe3b29287
commit
22e024e750
@ -4,7 +4,7 @@ const app = require('ui/modules').get('app/wazuh', []);
|
||||
app.controller('blankScreenController', function ($scope, $rootScope, errorHandler) {
|
||||
$scope.error = '';
|
||||
if($rootScope.blankScreenError) {
|
||||
$scope.error = $rootScope.blankScreenError;
|
||||
$scope.error = errorHandler.handle($rootScope.blankScreenError,'',false,true);
|
||||
delete $rootScope.blankScreenError;
|
||||
}
|
||||
});
|
@ -7,7 +7,8 @@ app.service('errorHandler', function ( Notifier, appState, $location) {
|
||||
if(error.data && error.data.errorData && error.data.errorData.message) return error.data.errorData.message;
|
||||
if(error.errorData && error.errorData.message) return error.errorData.message;
|
||||
if(error.data && typeof error.data === 'string') return error.data;
|
||||
if(error.data && error.data.message) return error.data.message;
|
||||
if(error.data && error.data.message && error.data.message === 'string') return error.data.message;
|
||||
if(error.data && error.data.message && error.data.message.msg && error.data.message.msg === 'string') return error.data.message.msg;
|
||||
if(error.data && error.data.data && typeof error.data.data === 'string') return error.data.data;
|
||||
if(typeof error.message === 'string') return error.message;
|
||||
if(error.message && error.message.msg) return error.message.msg;
|
||||
|
@ -31,9 +31,6 @@ module.exports = err => {
|
||||
err.message = `Unexpected error filtering the data. Error ${err.message}.`;
|
||||
} else if(err.message) {
|
||||
err['html'] = err.message;
|
||||
} else {
|
||||
err['html'] = "Unexpected error. Please, report this error.";
|
||||
err.message = "Unexpected error. Please, report this error.";
|
||||
}
|
||||
|
||||
return err;
|
||||
|
@ -178,20 +178,20 @@ const getIp = (Promise, courier, config, $q, $rootScope, $window, $location, Pri
|
||||
})
|
||||
.catch(error => {
|
||||
deferred.reject(error);
|
||||
$rootScope.blankScreenError = errorHandler.handle(error,'Elasticsearch');
|
||||
$rootScope.blankScreenError = errorHandler.handle(error,'Elasticsearch',false,true);
|
||||
$location.path('/blank-screen');
|
||||
});
|
||||
|
||||
})
|
||||
.catch(error => {
|
||||
deferred.reject(error);
|
||||
$rootScope.blankScreenError = errorHandler.handle(error,'Elasticsearch');
|
||||
$rootScope.blankScreenError = errorHandler.handle(error,'Elasticsearch',false,true);
|
||||
$location.path('/blank-screen');
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
deferred.reject(error);
|
||||
$rootScope.blankScreenError = errorHandler.handle(error,'Elasticsearch');
|
||||
$rootScope.blankScreenError = errorHandler.handle(error,'Elasticsearch',false,true);
|
||||
$location.path('/blank-screen');
|
||||
});
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ module.exports = (server, options) => {
|
||||
reply({
|
||||
'statusCode': 500,
|
||||
'error': 10000,
|
||||
'message': error
|
||||
'message': (error && error.message) ? error.message : error
|
||||
}).code(500);
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user