2019-11-30 23:19:08 +00:00
|
|
|
package server
|
|
|
|
|
|
|
|
type suspendedError struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *suspendedError) Error() string {
|
|
|
|
return "server is currently in a suspended state"
|
|
|
|
}
|
|
|
|
|
|
|
|
func IsSuspendedError(err error) bool {
|
|
|
|
_, ok := err.(*suspendedError)
|
|
|
|
|
|
|
|
return ok
|
2019-12-01 00:43:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
2019-12-17 04:47:35 +00:00
|
|
|
|
|
|
|
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
|
2020-09-05 19:08:40 +00:00
|
|
|
}
|