The error handling function (parse_response_error(), formerly gist_error_body()) should always include the response status code in the error message it returns and check the content-type header of the response. Only attempt to parse the json body if the content type is application/json, or *+json.
The error handling function (
parse_response_error()
, formerlygist_error_body()
) should always include the response status code in the error message it returns and check the content-type header of the response. Only attempt to parse the json body if the content type is application/json, or *+json.