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{
diff --git a/errors.go b/errors.go
index 1719fd2..726ba7e 100644
--- a/errors.go
+++ b/errors.go
@@ -26,11 +26,6 @@
// this error when attempting to register it against a context.
var ErrConfiguration = fmt.Errorf("Missing or incomplete configuration")
-// ErrEndpoint errors happen when no endpoint with the desired characteristics
-// exists in the service catalog. This can also happen if your tenant lacks
-// adequate permissions to access a given endpoint.
-var ErrEndpoint = fmt.Errorf("Missing endpoint, or insufficient privileges to access endpoint")
-
// ErrError errors happen when you attempt to discover the response code
// responsible for a previous request bombing with an error, but pass in an
// error interface which doesn't belong to the web client.