...

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

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

     1  package kclient
     2  
     3  import "fmt"
     4  
     5  // DeploymentNotFoundError returns an error if no deployment is found with the selector
     6  type DeploymentNotFoundError struct {
     7  	Selector string
     8  }
     9  
    10  func (e *DeploymentNotFoundError) Error() string {
    11  	return fmt.Sprintf("deployment not found for the selector: %s", e.Selector)
    12  }
    13  
    14  // ServiceNotFoundError returns an error if no service is found with the selector
    15  type ServiceNotFoundError struct {
    16  	Selector string
    17  }
    18  
    19  func (e *ServiceNotFoundError) Error() string {
    20  	return fmt.Sprintf("service not found for the selector %q", e.Selector)
    21  }
    22  
    23  type NoConnectionError struct{}
    24  
    25  func NewNoConnectionError() NoConnectionError {
    26  	return NoConnectionError{}
    27  }
    28  
    29  func (e NoConnectionError) Error() string {
    30  	// could also be "cluster is non accessible"
    31  	return "unable to access the cluster"
    32  }
    33  

View as plain text