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

Function handleError

integration/assets/hydrabroker/app/app.go:50–59  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request, err error)

Source from the content-addressed store, hash-verified

48}
49
50func handleError(w http.ResponseWriter, r *http.Request, err error) {
51 switch e := err.(type) {
52 case notFoundError:
53 http.NotFound(w, r)
54 case interface{ StatusCode() int }:
55 http.Error(w, err.Error(), e.StatusCode())
56 default:
57 http.Error(w, err.Error(), http.StatusInternalServerError)
58 }
59}

Callers 1

AppFunction · 0.70

Calls 2

ErrorMethod · 0.65
StatusCodeMethod · 0.65

Tested by

no test coverage detected