MCPcopy
hub / github.com/cli/cli / JSONErrorResponse

Function JSONErrorResponse

pkg/httpmock/stub.go:187–189  ·  view source on GitHub ↗

JSONErrorResponse is a type-safe helper to avoid confusion around the provided argument.

(status int, err api.HTTPError)

Source from the content-addressed store, hash-verified

185// JSONErrorResponse is a type-safe helper to avoid confusion around the
186// provided argument.
187func JSONErrorResponse(status int, err api.HTTPError) Responder {
188 return StatusJSONResponse(status, err)
189}
190
191func FileResponse(filename string) Responder {
192 return func(req *http.Request) (*http.Response, error) {

Callers 7

TestFetchRefSHAFunction · 0.92
Test_deleteRunFunction · 0.92
Test_gistDeleteFunction · 0.92
TestRerunFunction · 0.92
TestApiLogFetcherFunction · 0.92
TestWatchRunFunction · 0.92

Calls 1

StatusJSONResponseFunction · 0.85

Tested by 7

TestFetchRefSHAFunction · 0.74
Test_deleteRunFunction · 0.74
Test_gistDeleteFunction · 0.74
TestRerunFunction · 0.74
TestApiLogFetcherFunction · 0.74
TestWatchRunFunction · 0.74