MXS-1300: Return a rejected promise for unknown commands

When an unknow command is executed, the core should return a rejected
promise.
This commit is contained in:
Markus Mäkelä
2017-07-22 01:26:20 +03:00
parent 84dc0b2d37
commit 5edfe3040e
16 changed files with 66 additions and 35 deletions

View File

@ -44,6 +44,9 @@ module.exports = function() {
})
return Promise.all(promises)
.catch(function(err) {
argv.reject()
})
}, function(err) {
// One of the HTTP request pings to the cluster failed, log the error
logError(JSON.stringify(err.error, null, 4))
@ -209,7 +212,7 @@ module.exports = function() {
this.error = function(err) {
logger.log(colors.red('Error:'), err)
this.argv.reject()
return Promise.reject()
}
}