MCPcopy Create free account
hub / github.com/RanchoCooper/go-hexagonal / StatusCode

Method StatusCode

api/error_code/error_code.go:140–145  ·  view source on GitHub ↗

StatusCode returns the HTTP status code

()

Source from the content-addressed store, hash-verified

138
139// StatusCode returns the HTTP status code
140func (e *Error) StatusCode() int {
141 if e.HTTP != 0 {
142 return e.HTTP
143 }
144 return determineHTTPStatusCode(e.Code)
145}
146
147// determineHTTPStatusCode maps error codes to HTTP status codes
148func determineHTTPStatusCode(code int) int {

Callers 2

ToErrorResponseMethod · 0.45
ErrorFunction · 0.45

Calls 1

determineHTTPStatusCodeFunction · 0.85

Tested by

no test coverage detected