Improve init logging/error message
authorMikael Berthe <mikael@lilotux.net>
Sun, 30 Apr 2017 23:22:09 +0200
changeset 46 13717ea83333
parent 45 b58a7ea1aeb2
child 47 82d8b6074309
Improve init logging/error message
cmd/madon.go
--- a/cmd/madon.go	Sun Apr 30 23:22:09 2017 +0200
+++ b/cmd/madon.go	Sun Apr 30 23:22:09 2017 +0200
@@ -43,6 +43,10 @@
 		return errors.New("no instance provided")
 	}
 
+	if verbose {
+		errPrint("Instance: '%s'", instanceURL)
+	}
+
 	if appID != "" && appSecret != "" {
 		// We already have an app key/secret pair
 		gClient, err = madon.RestoreApp(AppName, instanceURL, appID, appSecret, nil)
@@ -51,10 +55,10 @@
 		}
 		// Check instance
 		if _, err := gClient.GetCurrentInstance(); err != nil {
-			return errors.New("could not use provided app secrets")
+			return errors.New("could not connect to server with provided app ID/secret")
 		}
 		if verbose {
-			errPrint("Using provided app secrets")
+			errPrint("Using provided app ID/secret")
 		}
 		return nil
 	}