more error types; RequestOptsBuilder error fixes
diff --git a/openstack/errors.go b/openstack/errors.go
index 8467200..8e4cbac 100644
--- a/openstack/errors.go
+++ b/openstack/errors.go
@@ -10,7 +10,7 @@
// ErrEndpointNotFound is the error when no suitable endpoint can be found
// in the user's catalog
-type ErrEndpointNotFound struct{ *gophercloud.BaseError }
+type ErrEndpointNotFound struct{ gophercloud.BaseError }
func (e ErrEndpointNotFound) Error() string {
return "No suitable endpoint could be found in the service catalog."
@@ -18,16 +18,16 @@
// ErrInvalidAvailabilityProvided is the error when an invalid endpoint
// availability is provided
-type ErrInvalidAvailabilityProvided struct{ *gophercloud.ErrInvalidInput }
+type ErrInvalidAvailabilityProvided struct{ gophercloud.ErrInvalidInput }
func (e ErrInvalidAvailabilityProvided) Error() string {
- return "Unexpected availability in endpoint query"
+ return fmt.Sprintf("Unexpected availability in endpoint query: %s", e.Value)
}
// ErrMultipleMatchingEndpointsV2 is the error when more than one endpoint
// for the given options is found in the v2 catalog
type ErrMultipleMatchingEndpointsV2 struct {
- *gophercloud.BaseError
+ gophercloud.BaseError
Endpoints []tokens2.Endpoint
}
@@ -38,7 +38,7 @@
// ErrMultipleMatchingEndpointsV3 is the error when more than one endpoint
// for the given options is found in the v3 catalog
type ErrMultipleMatchingEndpointsV3 struct {
- *gophercloud.BaseError
+ gophercloud.BaseError
Endpoints []tokens3.Endpoint
}
@@ -48,7 +48,7 @@
// ErrNoAuthURL is the error when the OS_AUTH_URL environment variable is not
// found
-type ErrNoAuthURL struct{ *gophercloud.ErrInvalidInput }
+type ErrNoAuthURL struct{ gophercloud.ErrInvalidInput }
func (e *ErrNoAuthURL) Error() string {
return "Environment variable OS_AUTH_URL needs to be set."
@@ -56,7 +56,7 @@
// ErrNoUsername is the error when the OS_USERNAME environment variable is not
// found
-type ErrNoUsername struct{ *gophercloud.ErrInvalidInput }
+type ErrNoUsername struct{ gophercloud.ErrInvalidInput }
func (e *ErrNoUsername) Error() string {
return "Environment variable OS_USERNAME needs to be set."
@@ -64,7 +64,7 @@
// ErrNoPassword is the error when the OS_PASSWORD environment variable is not
// found
-type ErrNoPassword struct{ *gophercloud.ErrInvalidInput }
+type ErrNoPassword struct{ gophercloud.ErrInvalidInput }
func (e *ErrNoPassword) Error() string {
return "Environment variable OS_PASSWORD needs to be set."