MCPcopy
hub / github.com/cli/cli / writeError

Method writeError

internal/barista/observability/telemetry.twirp.go:266–268  ·  view source on GitHub ↗

writeError writes an HTTP response with a valid Twirp error format, and triggers hooks. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)

(ctx context.Context, resp http.ResponseWriter, err error)

Source from the content-addressed store, hash-verified

264// writeError writes an HTTP response with a valid Twirp error format, and triggers hooks.
265// If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)
266func (s *telemetryAPIServer) writeError(ctx context.Context, resp http.ResponseWriter, err error) {
267 writeError(ctx, resp, err, s.hooks)
268}
269
270// handleRequestBodyError is used to handle error when the twirp server cannot read request
271func (s *telemetryAPIServer) handleRequestBodyError(ctx context.Context, resp http.ResponseWriter, msg string, err error) {

Callers 5

ServeHTTPMethod · 0.95
serveRecordEventsMethod · 0.95
serveRecordEventsJSONMethod · 0.95

Calls 1

writeErrorFunction · 0.85

Tested by

no test coverage detected