MCPcopy
hub / github.com/grafana/tempo / NewBadRequest

Function NewBadRequest

modules/frontend/pipeline/responses.go:69–75  ·  view source on GitHub ↗

NewBadRequest creates a new AsyncResponse that wraps a single http.Response with a 400 status code and the provided error message.

(err error)

Source from the content-addressed store, hash-verified

67
68// NewBadRequest creates a new AsyncResponse that wraps a single http.Response with a 400 status code and the provided error message.
69func NewBadRequest(err error) Responses[combiner.PipelineResponse] {
70 return NewHTTPToAsyncResponse(&http.Response{
71 StatusCode: http.StatusBadRequest,
72 Status: http.StatusText(http.StatusBadRequest),
73 Body: io.NopCloser(strings.NewReader(err.Error())),
74 })
75}
76
77// NewSuccessfulResponse creates a new AsyncResponse that wraps a single http.Response with a 200 status code and the provided body.
78func NewSuccessfulResponse(body string) Responses[combiner.PipelineResponse] {

Callers 10

RoundTripMethod · 0.92
RoundTripMethod · 0.92
RoundTripMethod · 0.92
RoundTripMethod · 0.85
RoundTripMethod · 0.85
RoundTripMethod · 0.85
RoundTripMethod · 0.85
RoundTripMethod · 0.85
RoundTripMethod · 0.85

Calls 2

NewHTTPToAsyncResponseFunction · 0.85
ErrorMethod · 0.65

Tested by 1