...

Source file src/github.com/redhat-developer/odo/pkg/component/errors.go

Documentation: github.com/redhat-developer/odo/pkg/component

     1  package component
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  // NoComponentFoundError is returned when no component of the specified name was found.
     8  type NoComponentFoundError struct {
     9  	name      string
    10  	namespace string
    11  }
    12  
    13  func NewNoComponentFoundError(name string, namespace string) NoComponentFoundError {
    14  	return NoComponentFoundError{
    15  		name:      name,
    16  		namespace: namespace,
    17  	}
    18  }
    19  func (e NoComponentFoundError) Error() string {
    20  	if e.namespace != "" {
    21  		return fmt.Sprintf("no component found with name %q in the namespace %q", e.name, e.namespace)
    22  	}
    23  	return fmt.Sprintf("no component found with name %q", e.name)
    24  }
    25  

View as plain text