Be more verbose when connection fails
authorMikael Berthe <mikael@lilotux.net>
Mon, 01 May 2017 14:33:57 +0200
changeset 53 4088535c4c4c
parent 52 2ffe0d622db9
child 54 c31ca7e1ac24
Be more verbose when connection fails Wrap the initial error message so we can guess if it's a credential issue or a server one.
cmd/madon.go
--- a/cmd/madon.go	Mon May 01 13:06:31 2017 +0200
+++ b/cmd/madon.go	Mon May 01 14:33:57 2017 +0200
@@ -55,7 +55,7 @@
 		}
 		// Check instance
 		if _, err := gClient.GetCurrentInstance(); err != nil {
-			return errors.New("could not connect to server with provided app ID/secret")
+			return errors.Wrap(err, "could not connect to server with provided app ID/secret")
 		}
 		if verbose {
 			errPrint("Using provided app ID/secret")