From 1e700ab9ba831975387904d8f8bc6954469e4d4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 30 Apr 2018 09:45:06 +0300 Subject: [PATCH] MXS-1832: Return 1 on failure If MaxScale responds with an error, MaxCtrl now returns 1. --- maxctrl/maxctrl.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/maxctrl/maxctrl.js b/maxctrl/maxctrl.js index f1206dadb..4c2a7b7cc 100644 --- a/maxctrl/maxctrl.js +++ b/maxctrl/maxctrl.js @@ -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)