MXS-1929: Improve JSON type error messages

If an invalid value or type is given to the REST API, having the expected
type as well as the given type make problem resolution easier.

Also added a value check into MaxCtrl for listener ports.
This commit is contained in:
Markus Mäkelä
2018-07-23 15:30:55 +03:00
parent 0c63471715
commit fb3101f7c4
2 changed files with 46 additions and 3 deletions

View File

@ -222,6 +222,10 @@ exports.builder = function(yargs) {
.usage('Usage: create listener <service> <name> <port>')
}, function(argv) {
if (!Number.isInteger(argv.port)) {
throw "'" + argv.port + "' is not a valid value for port"
}
var listener = {
'data': {
'id': argv.name,