cmd: merge ship types
This commit is contained in:
@@ -13,12 +13,14 @@ const (
|
||||
ErrDeleteShipTypeExistingGroup = 5000
|
||||
ErrDeleteShipTypePlanetProduction = 5001
|
||||
ErrDeleteSciencePlanetProduction = 5002
|
||||
ErrMergeShipTypeNotEqual = 5003
|
||||
)
|
||||
|
||||
const (
|
||||
ErrInputUnknownRace int = 3000 + iota
|
||||
ErrInputEntityTypeNameInvalid
|
||||
ErrInputEntityTypeNameDuplicate
|
||||
ErrInputEntityTypeNameEquality
|
||||
ErrInputEntityNotExists
|
||||
ErrInputEntityNotOwned
|
||||
ErrInputPlanetNumber
|
||||
@@ -47,6 +49,8 @@ func GenericErrorText(code int) string {
|
||||
return "Name has invalid length or symbols"
|
||||
case ErrInputEntityTypeNameDuplicate:
|
||||
return "Name already exists"
|
||||
case ErrInputEntityTypeNameEquality:
|
||||
return "Names should differ"
|
||||
case ErrInputEntityNotExists:
|
||||
return "Entity does not exists"
|
||||
case ErrInputEntityNotOwned:
|
||||
@@ -77,6 +81,8 @@ func GenericErrorText(code int) string {
|
||||
return "Science proportions sum should be equal 1"
|
||||
case ErrInputProductionInvalid:
|
||||
return "Invalid Production type"
|
||||
case ErrMergeShipTypeNotEqual:
|
||||
return "Source and target ship types are not the same"
|
||||
default:
|
||||
return fmt.Sprintf("Undescribed error with code %d", code)
|
||||
}
|
||||
|
||||
@@ -12,6 +12,10 @@ func NewEntityTypeNameDuplicateError(arg ...any) error {
|
||||
return newGenericError(ErrInputEntityTypeNameDuplicate, arg...)
|
||||
}
|
||||
|
||||
func NewEntityTypeNameEqualityError(arg ...any) error {
|
||||
return newGenericError(ErrInputEntityTypeNameEquality, arg...)
|
||||
}
|
||||
|
||||
func NewEntityNotExistsError(arg ...any) error {
|
||||
return newGenericError(ErrInputEntityNotExists, arg...)
|
||||
}
|
||||
@@ -59,3 +63,7 @@ func NewScienceSumValuesError(arg ...any) error {
|
||||
func NewProductionInvalidError(arg ...any) error {
|
||||
return newGenericError(ErrInputProductionInvalid, arg...)
|
||||
}
|
||||
|
||||
func NewMergeShipTypeNotEqualError(arg ...any) error {
|
||||
return newGenericError(ErrMergeShipTypeNotEqual, arg...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user