github.com/swisscom/cloudfoundry-cli@v7.1.0+incompatible/cf/errors/invalid_ssl_cert_error.go (about)

     1  package errors
     2  
     3  import (
     4  	. "code.cloudfoundry.org/cli/cf/i18n"
     5  )
     6  
     7  type InvalidSSLCert struct {
     8  	URL    string
     9  	Reason string
    10  }
    11  
    12  func NewInvalidSSLCert(url, reason string) *InvalidSSLCert {
    13  	return &InvalidSSLCert{
    14  		URL:    url,
    15  		Reason: reason,
    16  	}
    17  }
    18  
    19  func (err *InvalidSSLCert) Error() string {
    20  	message := T("Received invalid SSL certificate from ") + err.URL
    21  	if err.Reason != "" {
    22  		message += " - " + err.Reason
    23  	}
    24  	return message
    25  }