2015-08-18 11:26:42 +09:00
|
|
|
package mcnerror
|
2015-03-11 03:16:46 -04:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"errors"
|
2015-05-14 15:02:23 -07:00
|
|
|
"fmt"
|
2015-03-11 03:16:46 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var (
|
2015-11-12 17:23:52 +01:00
|
|
|
ErrInvalidHostname = errors.New("Invalid hostname specified. Allowed hostname chars are: 0-9a-zA-Z . -")
|
2015-03-11 03:16:46 -04:00
|
|
|
)
|
2015-05-14 15:02:23 -07:00
|
|
|
|
|
|
|
|
type ErrHostDoesNotExist struct {
|
|
|
|
|
Name string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (e ErrHostDoesNotExist) Error() string {
|
2015-08-18 11:26:42 +09:00
|
|
|
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)
|
2015-05-14 15:02:23 -07:00
|
|
|
}
|