github.com/sleungcy-sap/cli@v7.1.0+incompatible/cf/errors/curl_http_error.go (about)

     1  package errors
     2  
     3  import (
     4  	. "code.cloudfoundry.org/cli/cf/i18n"
     5  )
     6  
     7  type CurlHTTPError struct {
     8  	StatusCode int
     9  }
    10  
    11  func NewCurlHTTPError(statusCode int) error {
    12  	return &CurlHTTPError{StatusCode: statusCode}
    13  }
    14  
    15  func (err CurlHTTPError) Error() string {
    16  	return T("The requested URL returned error: {{.StatusCode}}", map[string]interface{}{"StatusCode": err.StatusCode})
    17  }