38 lines
783 B
Go
38 lines
783 B
Go
package domain
|
|
|
|
import "fmt"
|
|
|
|
type ServerDoesNotExistError struct {
|
|
VersionCode string
|
|
Key string
|
|
}
|
|
|
|
func (e ServerDoesNotExistError) Error() string {
|
|
return fmt.Sprintf("server (VersionCode=%s,Key=%s) doesn't exist", e.VersionCode, e.Key)
|
|
}
|
|
|
|
func (e ServerDoesNotExistError) UserError() string {
|
|
return e.Error()
|
|
}
|
|
|
|
func (e ServerDoesNotExistError) Code() ErrorCode {
|
|
return ErrorCodeValidationError
|
|
}
|
|
|
|
type ServerIsClosedError struct {
|
|
VersionCode string
|
|
Key string
|
|
}
|
|
|
|
func (e ServerIsClosedError) Error() string {
|
|
return fmt.Sprintf("server (VersionCode=%s,Key=%s) is closed", e.VersionCode, e.Key)
|
|
}
|
|
|
|
func (e ServerIsClosedError) UserError() string {
|
|
return e.Error()
|
|
}
|
|
|
|
func (e ServerIsClosedError) Code() ErrorCode {
|
|
return ErrorCodeValidationError
|
|
}
|