MCPcopy
hub / github.com/labstack/echo / StatusCode

Function StatusCode

httperror.go:45–51  ·  view source on GitHub ↗

StatusCode returns status code from err if it implements HTTPStatusCoder interface. If err does not implement the interface, it returns 0.

(err error)

Source from the content-addressed store, hash-verified

43// StatusCode returns status code from err if it implements HTTPStatusCoder interface.
44// If err does not implement the interface, it returns 0.
45func StatusCode(err error) int {
46 var sc HTTPStatusCoder
47 if errors.As(err, &sc) {
48 return sc.StatusCode()
49 }
50 return 0
51}
52
53// ResolveResponseStatus returns the Response and HTTP status code that should be (or has been) sent for rw,
54// given an optional error.

Callers 2

TestStatusCodeFunction · 0.85
ResolveResponseStatusFunction · 0.85

Calls 1

StatusCodeMethod · 0.95

Tested by 1

TestStatusCodeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…