MXS-1832: Return 1 on failure

If MaxScale responds with an error, MaxCtrl now returns 1.
This commit is contained in:
Markus Mäkelä 2018-04-30 09:45:06 +03:00
parent cca39b910d
commit 1e700ab9ba
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -21,6 +21,11 @@ function print(out) {
}
}
function err(out) {
print(out)
process.exit(1);
}
// Mangle the arguments if we are being called from the command line
if (process.argv[0] == process.execPath) {
process.argv.shift()
@ -29,4 +34,4 @@ if (process.argv[0] == process.execPath) {
}
maxctrl.execute(process.argv)
.then(print, print)
.then(print, err)