(response, logger)
return {}
Return the JSON object from a response, logging any errors.

    Args:
        response (requests.Response): a response object from a HTTP
            request.
        logger (logging.Logger): a logger object that can be used to
            write log messages.

    Returns:
        dict: a dict with the decoded JSON object within the HTTP
            response object.
Return the JSON object from a response, logging any errors.
Return the JSON object from a response logging any errors .
def get_response_json(response, logger):
    """Return the JSON object from a response, logging any errors.

    Args:
        response (requests.Response): a response object from a HTTP
            request.
        logger (logging.Logger): a logger object that can be used to
            write log messages.

    Returns:
        dict: a dict with the decoded JSON object within the HTTP
            response object.
    """
    status = response.status_code in definitions.HTTP_STATUS_CODE_20X
    if not status:
        reason = _get_reason(response)
        logger.warning('Failed response: [{0:d}] {2:s} {1:s}'.format(
            response.status_code, reason, _get_message(response)))

    try:
        return response.json()
    except json.JSONDecodeError as e:
        logger.error(
            'Unable to decode response: {0!s}'.format(e), exc_info=True)

    return {}
def get_response_json ( response , logger ) : status = response . status_code in definitions . HTTP_STATUS_CODE_20X if not status : reason = _get_reason ( response ) logger . warning ( 'Failed response: [{0:d}] {2:s} {1:s}' . format ( response . status_code , reason , _get_message ( response ) ) ) try : return response . json ( ) except json . JSONDecodeError as e : logger . error ( 'Unable to decode response: {0!s}' . format ( e ) , exc_info = True ) return { }