Make "Missing endpoint..." error more informative
Now it's "Missing endpoint, or insufficient privileges to access
endpoint; criteria = %# v"
diff --git a/context.go b/context.go
index a41cc6d..aca869c 100644
--- a/context.go
+++ b/context.go
@@ -3,6 +3,7 @@
import (
"net/http"
"strings"
+ "fmt"
)
// Provider structures exist for each tangible provider of OpenStack service.
@@ -110,7 +111,10 @@
func (c *Context) ServersApi(acc AccessProvider, criteria ApiCriteria) (CloudServersProvider, error) {
url := acc.FirstEndpointUrlByCriteria(criteria)
if url == "" {
- return nil, ErrEndpoint
+ var err = fmt.Errorf(
+ "Missing endpoint, or insufficient privileges to access endpoint; criteria = %# v",
+ criteria)
+ return nil, err
}
gcp := &genericServersProvider{