github.com/sleungcy-sap/cli@v7.1.0+incompatible/cf/errors/model_already_exists_error.go (about)

     1  package errors
     2  
     3  import (
     4  	"fmt"
     5  
     6  	. "code.cloudfoundry.org/cli/cf/i18n"
     7  )
     8  
     9  type ModelAlreadyExistsError struct {
    10  	ModelType string
    11  	ModelName string
    12  }
    13  
    14  func NewModelAlreadyExistsError(modelType, name string) *ModelAlreadyExistsError {
    15  	return &ModelAlreadyExistsError{
    16  		ModelType: modelType,
    17  		ModelName: name,
    18  	}
    19  }
    20  
    21  func (err *ModelAlreadyExistsError) Error() string {
    22  	return fmt.Sprintf(T("{{.ModelType}} {{.ModelName}} already exists",
    23  		map[string]interface{}{"ModelType": err.ModelType, "ModelName": err.ModelName}))
    24  }