github.com/jasonkeene/cli@v6.14.1-0.20160816203908-ca5715166dfb+incompatible/cf/errors/model_already_exists_error.go (about)

     1  package errors
     2  
     3  import (
     4  	"fmt"
     5  
     6  	. "github.com/cloudfoundry/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  }