MCPcopy
hub / github.com/cloudfoundry/cli / NewHTTPError

Function NewHTTPError

cf/errors/http_error.go:27–39  ·  view source on GitHub ↗
(statusCode int, code string, description string)

Source from the content-addressed store, hash-verified

25}
26
27func NewHTTPError(statusCode int, code string, description string) error {
28 err := baseHTTPError{
29 statusCode: statusCode,
30 apiErrorCode: code,
31 description: description,
32 }
33 switch statusCode {
34 case 404:
35 return &HTTPNotFoundError{err}
36 default:
37 return &err
38 }
39}
40
41func (err *baseHTTPError) StatusCode() int {
42 return err.statusCode

Callers 15

curl_test.goFile · 0.92
push_test.goFile · 0.92
app_test.goFile · 0.92
start_test.goFile · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected