SetCommonErrorResult set the common result that response body will be unmarshalled to if no error occurs but Response.ResultState returns ErrorState, by default it is HTTP status `code >= 400`, you can also use SetCommonResultStateChecker to customize the result state check logic.
(err any)
| 184 | // is HTTP status `code >= 400`, you can also use SetCommonResultStateChecker |
| 185 | // to customize the result state check logic. |
| 186 | func (c *Client) SetCommonErrorResult(err any) *Client { |
| 187 | if err != nil { |
| 188 | c.commonErrorType = util.GetType(err) |
| 189 | } |
| 190 | return c |
| 191 | } |
| 192 | |
| 193 | // ResultState represents the state of the result. |
| 194 | type ResultState int |