MCPcopy Create free account
hub / github.com/imroc/req / SetError

Method SetError

request.go:424–426  ·  view source on GitHub ↗

SetError set the result that response body will be unmarshalled to if no error occurs and Response.ResultState() returns ErrorState, by default it requires HTTP status `code >= 400`, you can also use Client.SetResultStateCheckFunc to customize the result state check logic. Deprecated: Use SetErrorR

(err any)

Source from the content-addressed store, hash-verified

422//
423// Deprecated: Use SetErrorResult result.
424func (r *Request) SetError(err any) *Request {
425 return r.SetErrorResult(err)
426}
427
428// SetErrorResult set the result that response body will be unmarshalled to if
429// no error occurs and Response.ResultState() returns ErrorState, by default

Callers

nothing calls this directly

Calls 1

SetErrorResultMethod · 0.95

Tested by

no test coverage detected