|
@@ -27,7 +27,7 @@ func checkError(resp *http.Response, body []byte) error {
|
|
err := json.Unmarshal(body, &apiError)
|
|
err := json.Unmarshal(body, &apiError)
|
|
if err != nil {
|
|
if err != nil {
|
|
// Use the full body as the message if we fail to decode a response.
|
|
// Use the full body as the message if we fail to decode a response.
|
|
- apiError.Message = string(body)
|
|
|
|
|
|
+ apiError.ErrorMessage = string(body)
|
|
}
|
|
}
|
|
|
|
|
|
return apiError
|
|
return apiError
|
|
@@ -92,7 +92,6 @@ func (c *Client) do(ctx context.Context, method, path string, reqData, respData
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return nil
|
|
return nil
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
func (c *Client) stream(ctx context.Context, method, path string, data any, fn func([]byte) error) error {
|
|
func (c *Client) stream(ctx context.Context, method, path string, data any, fn func([]byte) error) error {
|
|
@@ -137,9 +136,9 @@ func (c *Client) stream(ctx context.Context, method, path string, data any, fn f
|
|
|
|
|
|
if response.StatusCode >= 400 {
|
|
if response.StatusCode >= 400 {
|
|
return StatusError{
|
|
return StatusError{
|
|
- StatusCode: response.StatusCode,
|
|
|
|
- Status: response.Status,
|
|
|
|
- Message: errorResponse.Error,
|
|
|
|
|
|
+ StatusCode: response.StatusCode,
|
|
|
|
+ Status: response.Status,
|
|
|
|
+ ErrorMessage: errorResponse.Error,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|