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

Function Error

pkg/http/errors.go:24–29  ·  view source on GitHub ↗

Error returns an error that can be used to write an HTTP response with an error message and a specific status code.

(err error, code int)

Source from the content-addressed store, hash-verified

22// Error returns an error that can be used to write an
23// HTTP response with an error message and a specific status code.
24func Error(err error, code int) error {
25 return &HTTPError{
26 code: code,
27 err: err,
28 }
29}
30
31// ErrorStr is like Error but takes a string message instead of an error.
32func ErrorStr(err string, code int) error {

Callers 3

TestWriteErrorJSONFunction · 0.85
ErrorStrFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestWriteErrorJSONFunction · 0.68