MCPcopy Create free account
hub / github.com/DoNewsCode/core / EncodeError

Method EncodeError

srvhttp/encode.go:53–55  ·  view source on GitHub ↗

EncodeError encodes an Error. If the error is not a StatusCoder, the http.StatusInternalServerError will be used.

(err error)

Source from the content-addressed store, hash-verified

51
52// EncodeError encodes an Error. If the error is not a StatusCoder, the http.StatusInternalServerError will be used.
53func (s *ResponseEncoder) EncodeError(err error) {
54 encode(s.w, err, http.StatusInternalServerError)
55}
56
57// EncodeResponse encodes an response value.
58// If the response is not a StatusCoder, the http.StatusInternalServerError will be used.

Callers 2

EncodeMethod · 0.95

Calls 1

encodeFunction · 0.85

Tested by 1