wings/server/errors.go
Matthew Penner 5c78cb9ab3
Add transfer logging output (#77)
Co-authored-by: Dane Everitt <dane@daneeveritt.com>
2020-12-25 13:32:41 -08:00

39 lines
830 B
Go

package server
import (
"emperror.dev/errors"
)
var (
ErrIsRunning = errors.New("server is running")
ErrSuspended = errors.New("server is currently in a suspended state")
ErrServerIsInstalling = errors.New("server is currently installing")
ErrServerIsTransferring = errors.New("server is currently being transferred")
)
type crashTooFrequent struct {
}
func (e *crashTooFrequent) Error() string {
return "server has crashed too soon after the last detected crash"
}
func IsTooFrequentCrashError(err error) bool {
_, ok := err.(*crashTooFrequent)
return ok
}
type serverDoesNotExist struct {
}
func (e *serverDoesNotExist) Error() string {
return "server does not exist on remote system"
}
func IsServerDoesNotExistError(err error) bool {
_, ok := err.(*serverDoesNotExist)
return ok
}