'Log server response if there was an error.'

def _log_if_raised(self, response, data):

    try:
        response.raise_for_status()
    except HTTPError:
        LOGGER.error(u'Encountered    an    error    when    contacting    the    Badgr-Server.    Request    sent    to    %r    with    headers    %r.\nand    data    values    %r\nResponse    status    was    %s.\n%s', response.request.url, response.request.headers, data, response.status_code, response.content)
        raise
