Return a rejected promise instead of throwing an error

This commit is contained in:
Jesús Ángel 2019-03-05 16:11:34 +01:00
parent 989b3b3f5b
commit 1e6cc24668

View File

@ -219,8 +219,7 @@ app.directive('wzXmlFileEditor', function() {
return true;
} catch (error) {
$scope.configError = false;
errorHandler.handle(error, 'Error asdfas');
throw new Error(error);
return Promise.reject(error);
}
};
@ -316,7 +315,7 @@ app.directive('wzXmlFileEditor', function() {
} catch (error) {
$scope.savingParam();
if ((error || '').includes('Wazuh API error: 1905')) {
$scope.configError = ["File name already exists"];
$scope.configError = ['File name already exists'];
$scope.$emit('showSaveAndOverwrite', {});
} else {
errorHandler.handle(error, 'Error');