MCPcopy Create free account
hub / github.com/aeilang/httpz / NewHTTPError

Function NewHTTPError

error.go:36–41  ·  view source on GitHub ↗

NewHTTPError creates a new HTTPError with the given status code and message.

(statusCode int, msg string)

Source from the content-addressed store, hash-verified

34
35// NewHTTPError creates a new HTTPError with the given status code and message.
36func NewHTTPError(statusCode int, msg string) *HTTPError {
37 return &HTTPError{
38 StatusCode: statusCode,
39 Msg: msg,
40 }
41}
42
43// SetInternal sets the internal error for the HTTPError.
44func (e *HTTPError) SetInternal(err error) *HTTPError {

Callers 12

mainFunction · 0.92
BindPathParamsFunction · 0.85
BindQueryParamsFunction · 0.85
BindBodyFunction · 0.85
BindHeadersFunction · 0.85
error.goFile · 0.85
TestNewHTTPErrorFunction · 0.85
TestHTTPError_ErrorFunction · 0.85
TestHTTPError_UnwrapFunction · 0.85
TestErrorHandlerFunction · 0.85

Calls

no outgoing calls

Tested by 6

TestNewHTTPErrorFunction · 0.68
TestHTTPError_ErrorFunction · 0.68
TestHTTPError_UnwrapFunction · 0.68
TestErrorHandlerFunction · 0.68