17530: Added check if API host is missing
[arvados.git] / sdk / go / arvadosclient / arvadosclient.go
index d90c618f7a1effa8c3da8031cb98909a1b37df3f..4c594625e700d086d7d1a68764b640b247219fda 100644 (file)
@@ -206,6 +206,9 @@ func (c *ArvadosClient) CallRaw(method string, resourceType string, uuid string,
        if scheme == "" {
                scheme = "https"
        }
+       if c.ApiServer == "" {
+               return nil, fmt.Errorf("Arvados client is not configured (target API host is not set). Maybe env var ARVADOS_API_HOST should be set first?")
+       }
        u := url.URL{
                Scheme: scheme,
                Host:   c.ApiServer}