github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/actor/actionerror/service_not_found_error.go (about)

     1  package actionerror
     2  
     3  import "fmt"
     4  
     5  type ServiceNotFoundError struct {
     6  	Name, Broker string
     7  }
     8  
     9  func (e ServiceNotFoundError) Error() string {
    10  	if e.Name != "" && e.Broker != "" {
    11  		return fmt.Sprintf("Service offering '%s' for service broker '%s' not found.", e.Name, e.Broker)
    12  	}
    13  
    14  	if e.Name != "" {
    15  		return fmt.Sprintf("Service offering '%s' not found.", e.Name)
    16  	}
    17  
    18  	if e.Broker != "" {
    19  		return fmt.Sprintf("No service offerings found for service broker '%s'.", e.Broker)
    20  	}
    21  
    22  	return "No service offerings found."
    23  }