def _check_error(self, response, json_response=None):
<EOL>if response.status_code >= <NUM_LIT>:<EOL><INDENT>json_response = json_response or self._get_json_response(response)<EOL>err_cls = self._check_http_error_code(response.status_code)<EOL>try:<EOL><INDENT>raise err_cls("<STR_LIT>" % (response.status_code, json_response["<STR_LIT:error>"]["<STR_LIT>"]), response.status_code)<EOL><DEDENT>except TypeError:<EOL><INDENT>raise err_cls("<STR_LIT>" % (response.status_code, json_response["<STR_LIT>"]), response.status_code)<EOL><DEDENT><DEDENT>return True<EOL>
Check for HTTP error code from the response, raise exception if there's any

        Args:
            response (object): Object returned by requests' `get` and `post`
                methods

            json_response (dict): JSON response, if applicable

        Raises:
            HTTPError: If the status code of response is either 4xx or 5xx

        Returns:
            True if status code is not error code