github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/errors/ambiguous_model_error.go (about)

     1  package errors
     2  
     3  import (
     4  	"strings"
     5  
     6  	. "code.cloudfoundry.org/cli/cf/i18n"
     7  )
     8  
     9  type AmbiguousModelError struct {
    10  	ModelType string
    11  	ModelName string
    12  }
    13  
    14  func NewAmbiguousModelError(modelType, name string) error {
    15  	return &AmbiguousModelError{
    16  		ModelType: modelType,
    17  		ModelName: name,
    18  	}
    19  }
    20  
    21  func (err *AmbiguousModelError) Error() string {
    22  	return T("Multiple ") + strings.ToLower(err.ModelType) + "s named " + err.ModelName + T(" found.")
    23  }