MCPcopy
hub / github.com/grafana/dskit / checkError

Function checkError

httpgrpc/server/server_test.go:258–262  ·  view source on GitHub ↗
(t *testing.T, err error, expectedCode int, expectedMessage string)

Source from the content-addressed store, hash-verified

256}
257
258func checkError(t *testing.T, err error, expectedCode int, expectedMessage string) {
259 resp, ok := httpgrpc.HTTPResponseFromError(err)
260 require.True(t, ok)
261 checkHTTPResponse(t, resp, expectedCode, expectedMessage)
262}
263
264func checkHTTPResponse(t *testing.T, resp *httpgrpc.HTTPResponse, expectedCode int, expectedBody string) {
265 require.Equal(t, int32(expectedCode), resp.GetCode())

Callers 2

Calls 2

HTTPResponseFromErrorFunction · 0.92
checkHTTPResponseFunction · 0.85

Tested by

no test coverage detected