From 7531b9bbd349e83553f2f3ede5ccddaddce994c2 Mon Sep 17 00:00:00 2001 From: Nikhil Saraf <1028334+nikhilsaraf@users.noreply.github.com> Date: Sun, 28 Mar 2021 20:23:23 +0530 Subject: [PATCH] log error in checkInitRootFlags() --- cmd/root.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/root.go b/cmd/root.go index 3de61f70a..30859731c 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "log" "net/http" "os" "strings" @@ -85,16 +86,19 @@ func checkInitRootFlags() { if *rootCcxtRestURL != "" { *rootCcxtRestURL = strings.TrimSuffix(*rootCcxtRestURL, "/") if !strings.HasPrefix(*rootCcxtRestURL, "http://") && !strings.HasPrefix(*rootCcxtRestURL, "https://") { + log.Printf("'ccxt-rest-url' argument must start with either `http://` or `https://`") panic("'ccxt-rest-url' argument must start with either `http://` or `https://`") } e := isCcxtUp(*rootCcxtRestURL) if e != nil { + log.Printf(e.Error()) panic(e) } e = sdk.SetBaseURL(*rootCcxtRestURL) if e != nil { + log.Printf("unable to set CCXT-rest URL to '%s': %s", *rootCcxtRestURL, e) panic(fmt.Errorf("unable to set CCXT-rest URL to '%s': %s", *rootCcxtRestURL, e)) } }