Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
log error in checkInitRootFlags()
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilsaraf committed Mar 28, 2021
1 parent d52dea2 commit 7531b9b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"fmt"
"log"
"net/http"
"os"
"strings"
Expand Down Expand Up @@ -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))
}
}
Expand Down

0 comments on commit 7531b9b

Please sign in to comment.