MCPcopy Index your code
hub / github.com/SpectoLabs/hoverfly / handleResponseError

Function handleResponseError

hoverctl/wrapper/hoverfly.go:308–323  ·  view source on GitHub ↗
(response *http.Response, errorMessage string)

Source from the content-addressed store, hash-verified

306}
307
308func handleResponseError(response *http.Response, errorMessage string) error {
309 if response.StatusCode != 200 {
310 defer response.Body.Close()
311 responseError, _ := io.ReadAll(response.Body)
312
313 errSchema := &ErrorSchema{}
314
315 err := json.Unmarshal(responseError, errSchema)
316 if err != nil {
317 return errors.New(errorMessage + "\n\n" + string(responseError))
318 }
319 return errors.New(errorMessage + "\n\n" + errSchema.ErrorMessage)
320 }
321
322 return nil
323}

Callers 15

GetLogsFunction · 0.85
GetAllJournalIndexesFunction · 0.85
SetJournalIndexFunction · 0.85
DeleteJournalIndexFunction · 0.85
GetAllPostServeActionsFunction · 0.85
SetLocalPostServeActionFunction · 0.85
SetRemotePostServeActionFunction · 0.85
DeletePostServeActionFunction · 0.85
GetModeFunction · 0.85
SetModeWithArgumentsFunction · 0.85
FlushCacheFunction · 0.85
SetPACFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected