github.com/lukasheimann/cloudfoundrycli@v7.1.0+incompatible/command/translatableerror/no_current_droplet_for_app_error.go (about)

     1  package translatableerror
     2  
     3  // NoDropletForAppError will default to current droplet if no droplet GUID is provided
     4  type NoDropletForAppError struct {
     5  	AppName     string
     6  	DropletGUID string
     7  }
     8  
     9  func (e NoDropletForAppError) Error() string {
    10  	if e.DropletGUID != "" {
    11  		return "Droplet '{{.DropletGUID}}' not found for app '{{.AppName}}'"
    12  	}
    13  	return "App '{{.AppName}}' does not have a current droplet."
    14  }
    15  
    16  func (e NoDropletForAppError) Translate(translate func(string, ...interface{}) string) string {
    17  	return translate(e.Error(), map[string]interface{}{
    18  		"AppName":     e.AppName,
    19  		"DropletGUID": e.DropletGUID,
    20  	})
    21  }