MCPcopy
hub / github.com/koderover/zadig / NewHTTPError

Function NewHTTPError

pkg/tool/errors/errors.go:42–54  ·  view source on GitHub ↗

NewHTTPError ...

(code int, errStr string, args ...string)

Source from the content-addressed store, hash-verified

40
41// NewHTTPError ...
42func NewHTTPError(code int, errStr string, args ...string) *HTTPError {
43
44 var desc string
45 if len(args) > 0 {
46 desc = args[0]
47 }
48
49 return &HTTPError{
50 code: code,
51 err: errStr,
52 desc: desc,
53 }
54}
55
56// Code ...
57func (e *HTTPError) Code() int {

Callers 3

TestErrorsFunction · 0.85
http_errors.goFile · 0.85
ErrorMessageFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestErrorsFunction · 0.68