Files
docker-machine/libmachine/mcnerror/errors.go
Jean-Laurent de Morlhon 45a8f5e7a6 Returns exit code 3 on pre-create check
Signed-off-by: Jean-Laurent de Morlhon <jeanlaurent@morlhon.net>
2016-01-12 11:04:39 +01:00

35 lines
632 B
Go

package mcnerror
import (
"errors"
"fmt"
)
var (
ErrInvalidHostname = errors.New("Invalid hostname specified. Allowed hostname chars are: 0-9a-zA-Z . -")
)
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)
}
type ErrDuringPreCreate struct {
Cause error
}
func (e ErrDuringPreCreate) Error() string {
return fmt.Sprintf("Error with pre-create check: %q", e.Cause)
}