MCPcopy
hub / github.com/harness/harness / UserError

Function UserError

app/api/render/render_error.go:72–76  ·  view source on GitHub ↗

UserError writes the json-encoded user error.

(ctx context.Context, w http.ResponseWriter, err *usererror.Error)

Source from the content-addressed store, hash-verified

70
71// UserError writes the json-encoded user error.
72func UserError(ctx context.Context, w http.ResponseWriter, err *usererror.Error) {
73 log.Ctx(ctx).Debug().Err(err).Msgf("operation resulted in user facing error")
74
75 JSON(w, err.Status, err)
76}

Callers 12

TestWriteErrorfFunction · 0.85
TestWriteErrorCodeFunction · 0.85
TranslatedUserErrorFunction · 0.85
NotFoundFunction · 0.85
UnauthorizedFunction · 0.85
ForbiddenFunction · 0.85
ForbiddenfFunction · 0.85
BadRequestFunction · 0.85
BadRequestfFunction · 0.85
InternalErrorFunction · 0.85
InternalErrorfFunction · 0.85
StreamSSEFunction · 0.85

Calls 4

JSONFunction · 0.85
MsgfMethod · 0.80
ErrMethod · 0.65
DebugMethod · 0.65

Tested by 2

TestWriteErrorfFunction · 0.68
TestWriteErrorCodeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…