Files
docker-machine/libmachine/mcnerror/errors.go
Kendrick Coleman 3ed0377956 clarified hostname error with valid characters
this is a fix for #1922 to add in a valid character error message.

Signed-off-by: Kendrick Coleman <kendrickcoleman@gmail.com>
2015-10-08 15:15:09 -04:00

28 lines
539 B
Go

package mcnerror
import (
"errors"
"fmt"
)
var (
ErrInvalidHostname = errors.New("Invalid hostname specified. Allowed hostname chars are: 0-9a-zA-Z . -")
ErrUnknownProviderType = errors.New("Unknown hypervisor type")
)
type ErrHostDoesNotExist struct {
Name string
}
func (e ErrHostDoesNotExist) Error() string {
return fmt.Sprintf("Host does not exist: %q", e.Name)
}
type ErrHostAlreadyExists struct {
Name string
}
func (e ErrHostAlreadyExists) Error() string {
return fmt.Sprintf("Host already exists: %q", e.Name)
}