MCPcopy
hub / github.com/akuity/kargo / ErrorStr

Function ErrorStr

pkg/http/errors.go:32–34  ·  view source on GitHub ↗

ErrorStr is like Error but takes a string message instead of an error.

(err string, code int)

Source from the content-addressed store, hash-verified

30
31// ErrorStr is like Error but takes a string message instead of an error.
32func ErrorStr(err string, code int) error {
33 return Error(errors.New(err), code)
34}
35
36// WriteErrorJSON writes an error response in JSON format to the provided
37// http.ResponseWriter. If the error is an *httpError, it uses the code

Callers

nothing calls this directly

Calls 1

ErrorFunction · 0.85

Tested by

no test coverage detected