github.com/gophercloud/gophercloud@v1.11.0/openstack/errors.go (about) 1 package openstack 2 3 import ( 4 "fmt" 5 6 "github.com/gophercloud/gophercloud" 7 ) 8 9 // ErrEndpointNotFound is the error when no suitable endpoint can be found 10 // in the user's catalog 11 type ErrEndpointNotFound struct{ gophercloud.BaseError } 12 13 func (e ErrEndpointNotFound) Error() string { 14 return "No suitable endpoint could be found in the service catalog." 15 } 16 17 // ErrInvalidAvailabilityProvided is the error when an invalid endpoint 18 // availability is provided 19 type ErrInvalidAvailabilityProvided struct{ gophercloud.ErrInvalidInput } 20 21 func (e ErrInvalidAvailabilityProvided) Error() string { 22 return fmt.Sprintf("Unexpected availability in endpoint query: %s", e.Value) 23 } 24 25 // ErrNoAuthURL is the error when the OS_AUTH_URL environment variable is not 26 // found 27 type ErrNoAuthURL struct{ gophercloud.ErrInvalidInput } 28 29 func (e ErrNoAuthURL) Error() string { 30 return "Environment variable OS_AUTH_URL needs to be set." 31 } 32 33 // ErrNoUsername is the error when the OS_USERNAME environment variable is not 34 // found 35 type ErrNoUsername struct{ gophercloud.ErrInvalidInput } 36 37 func (e ErrNoUsername) Error() string { 38 return "Environment variable OS_USERNAME needs to be set." 39 } 40 41 // ErrNoPassword is the error when the OS_PASSWORD environment variable is not 42 // found 43 type ErrNoPassword struct{ gophercloud.ErrInvalidInput } 44 45 func (e ErrNoPassword) Error() string { 46 return "Environment variable OS_PASSWORD needs to be set." 47 }