MCPcopy Index your code
hub / github.com/cockroachdb/errors / WrapWithHTTPCode

Function WrapWithHTTPCode

exthttp/ext_http.go:37–42  ·  view source on GitHub ↗

WrapWithHTTPCode adds a HTTP code to an existing error.

(err error, code int)

Source from the content-addressed store, hash-verified

35
36// WrapWithHTTPCode adds a HTTP code to an existing error.
37func WrapWithHTTPCode(err error, code int) error {
38 if err == nil {
39 return nil
40 }
41 return &withHTTPCode{cause: err, code: code}
42}
43
44// GetHTTPCode retrieves the HTTP code from a stack of causes.
45func GetHTTPCode(err error, defaultCode int) int {

Callers 1

TestHTTPFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestHTTPFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…