From 26e9f78a869d3cedeba6b5aff9b37b59e4097c61 Mon Sep 17 00:00:00 2001 From: kannappanr <30541348+kannappanr@users.noreply.github.com> Date: Wed, 1 Nov 2017 11:45:27 -0700 Subject: [PATCH] Display help when access/secret key is not set (#5132) Display help message, when access and secret keys are not set in any of the gateway. Fixes #5124 --- cmd/gateway-main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/gateway-main.go b/cmd/gateway-main.go index 70f26b2b2..05d7aa672 100644 --- a/cmd/gateway-main.go +++ b/cmd/gateway-main.go @@ -144,7 +144,8 @@ func startGateway(ctx *cli.Context, gw Gateway) { // Validate if we have access, secret set through environment. gatewayName := gw.Name() if !globalIsEnvCreds { - fatalIf(fmt.Errorf("Access and Secret keys should be set through ENVs for backend [%s]", gatewayName), "") + errorIf(errors.New("Access and secret keys not set"), "Access and Secret keys should be set through ENVs for backend [%s]", gatewayName) + cli.ShowCommandHelpAndExit(ctx, gatewayName, 1) } // Create certs path.